Closed jdemilledt closed 7 years ago
Emphasis on a subcommand? As in there should be global options and they should be used for all but one subcommand?
Also, -h|--help and -V|--version will always be there.
Yes, that is correct
Not really, but inside the subcommand switch you could check if any of the options were used. However, they will be shown in the help output because that's somewhat modular, first show global options then the subcommand sepcific options.
Ok, that's fine. I see you have an option --no-auto-flags
that excludes -h|--help and -V|--version. Could you make an option to exclude -V|--version only? I would implement that, but the source code is far more advanced than I've ever dealt with
Sure, that's easy: commit 16cf0db has the --no-auto-flags split into --no-auto-help and --no-auto-version (and for backward compatibility the --no-auto-flags)
I hope saying the code is advanced doesn't secretly mean it's a mess? :)
@hroptatyr It's too advanced for me to tell if it's spaghetti code or not. I honestly don't care if it's a mess. It works amazingly.
Is there any way to omit global options for a subcommand?