Univention Bugzilla – Bug 55204
Wrong argument order in univention-app configure help message
Last modified: 2022-09-16 10:44:11 CEST
Running `univention-app configure -h` returns: ``` usage: univention-app configure [-h] [--list] [--set KEY=VALUE [KEY=VALUE ...]] [--unset KEY [KEY ...]] [--run-script {settings,install,upgrade,remove,no}] [--autostart {yes,manually,no}] app ``` But the `app` should be placed first (at least before `--set KEY=VALUE [KEY=VALUE ...]`.
--help is auto-generated by Python argparse.ArgumentParser; having arguments with nargs="+" leads to these kind of ambiguity problems. Therefore put an "--" between the "optional" and "positional" argument to help the parser: >>> from argparse import ArgumentParser >>> p = ArgumentParser() >>> p.add_argument("--optional", nargs="+") >>> p.add_argument("required") >>> o = p.parse_args("--optional 1 2 -- 3".split()) >>> o.optional ['1', '2'] >>> o.required '3' Probably WONTFIX.