Bug 52514 - wrong option order in univention-app help text
wrong option order in univention-app help text
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Mika Westphal
Florian Best
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-18 11:40 CET by Daniel Tröder
Modified: 2022-12-21 20:23 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2020-12-18 11:40:49 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.
Comment 1 Florian Best univentionstaff 2021-01-26 19:57:58 CET
git:abeaf5a1e33993066a0226630ef0af3c02073cab has not been merged to UCS 5.
Comment 2 Dirk Wiesenthal univentionstaff 2021-01-27 01:22:20 CET
(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?
Comment 3 Florian Best univentionstaff 2021-01-27 09:44:58 CET
(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.
Comment 4 Dirk Ahrnke univentionstaff 2022-06-07 15:51:47 CEST
I can not say exactly how long it took me to figure out whats wrong with a command that was built exactly as documented.
Comment 5 Mika Westphal univentionstaff 2022-11-11 14:26:40 CET
That's a bug from Argpars. There is already a bug opened on the python GitHub page: https://github.com/python/cpython/issues/53584
Comment 6 Mika Westphal univentionstaff 2022-12-01 11:36:51 CET
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
Comment 7 Florian Best univentionstaff 2022-12-07 11:07:29 CET
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