Bug 55204 - Wrong argument order in univention-app configure help message
Wrong argument order in univention-app configure help message
Status: NEW
Product: UCS
Classification: Unclassified
Component: App Center
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: App Center maintainers
App Center maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-15 12:27 CEST by Carlos García-Mauriño
Modified: 2022-09-16 10:44 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.006
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos García-Mauriño univentionstaff 2022-09-15 12:27:40 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 ...]`.
Comment 1 Philipp Hahn univentionstaff 2022-09-16 10:44:11 CEST
--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.