feat: allow usage of '-u' flag with commands#1827
feat: allow usage of '-u' flag with commands#1827hunterhogan wants to merge 4 commits intoadobe-type-tools:developfrom
Conversation
|
I think all of these subcommands support -h but they don't all support -u, which makes this change a little flakey. |
Quite right. I think all of these produce an error on
I tried to think of an extra clever solution that could be implemented only in "invoker.py," but I didn't come up with anything. Right now, if -u is in the second position, the user always gets an error. >afdko -u otc2otf
Error: Unknown command '-u'
Run 'afdko --help' for usage.
>afdko -u tx
Error: Unknown command '-u'
Run 'afdko --help' for usage.One idea is to treat the out-of-place "-u" the same as "--help". if subcmd in ('-h', '--help', 'help', '-u'):But, it might be better to reject this updated PR, because
I don't have a recommendation for y'all. :/ |
|
Wouldn't the clever solution be to maintain a set of the names of those tools and swap in -h for -u when calling one of them? |
Well, if the list were dynamically generated, then that would be perfect. I couldn't think of a way to do that. If the list were static and had to be updated, then it would be helpful to the users, but more work for the maintainers. |
Description
Enhancement to the invoker that allows the use of the '-u' flag before or after commands, enabling users to forward usage requests more flexibly. This change affects the command dispatching logic and includes new tests to verify the functionality.
Checklist:
The same 31 tests fail on my system before and after this change.