diff --git a/dput.py b/dput.py index 1d594fe002361341dc006442c1193b4604ab7eea..e97f9f9aa2185b413173e08f0a3660a2bc63a39c 100644 --- a/dput.py +++ b/dput.py @@ -35,4 +35,15 @@ def do_dput(self, subcmd, opts, *args): if hasattr(self, "osc_plugin_dput"): osc_plugin_dput = self.osc_plugin_dput # noqa: F811 + # osc 1.x removes get_cmd_help, inject a replacement + if not hasattr(self, "get_cmd_help"): + def format_help(subcmd, opts=None, *args): + for action in self.argparser._actions: + if not isinstance(action, argparse._SubParsersAction): + continue + for choice, subparser in action.choices.items(): + if choice == subcmd: + return subparser.format_help() + self.get_cmd_help = format_help + osc_plugin_dput.do_dput(self, subcmd, opts, *args)