Univention Bugzilla – Bug 52514
wrong option order in univention-app help text
Last modified: 2022-12-21 20:23:36 CET
The help text of univention-app says that options must be passed before the app-id, but that produced an error. For example: ------------------------------------------------------------------- univention-app configure --set asm/username=foo --set asm/password=bar apple-school-manager 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 univention-app configure: error: Could not parse apple-school-manager. Use var=val. Skipping... ------------------------------------------------------------------- It seems that the app-id must always be the first argument. Fix the help text of all (sub)commands of the appcenter cli.
git:abeaf5a1e33993066a0226630ef0af3c02073cab has not been merged to UCS 5.
(In reply to Florian Best from comment #1) > git:abeaf5a1e33993066a0226630ef0af3c02073cab has not been merged to UCS 5. The commit seems wrong. Maybe only the correct one made it to UCS 5?
(In reply to Dirk Wiesenthal from comment #2) > (In reply to Florian Best from comment #1) > > git:abeaf5a1e33993066a0226630ef0af3c02073cab has not been merged to UCS 5. > > The commit seems wrong. Maybe only the correct one made it to UCS 5? Yes, it seems also to be reverted.
I can not say exactly how long it took me to figure out whats wrong with a command that was built exactly as documented.
That's a bug from Argpars. There is already a bug opened on the python GitHub page: https://github.com/python/cpython/issues/53584
The change was made, because the argument order of the usage was not right. It was patched through text replacement. It can be tested with "univention-app configure -h" univention-appcenter.yaml 8f01f5f8b06b | Bug #52514: YAML 4cae51243624 | Bug #52514: fixed order of positional arguments in the help text of univention-app configure univention-appcenter (9.0.3-6) 4cae51243624 | Bug #52514: fixed order of positional arguments in the help text of univention-app configure
OK: new help format works # univention-app configure --set asm/username=foo --set asm/password=bar apple-school-manager usage: univention-app configure [-h] app [--list] [--set KEY=VALUE [KEY=VALUE ...]] [--unset KEY [KEY ...]] [--run-script {settings,install,upgrade,remove,no}] [--autostart {yes,manually,no}] univention-app configure: error: Could not parse apple-school-manager. Use var=val. Skipping... OK: code review, unfortionately there is no easy way via subclassing a HelpFormatter except for that string replacement. OK: YAML
<https://errata.software-univention.de/#/?erratum=5.0x525>