-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for showing Subgroups / Subcommands in Help print #123
Comments
Thank you, I agree that this feature is necessary! The current problem is that when a Root command does not exist, there is no way to set the Description for the Group. |
@neuecc Thank you for responding so quick, yes framework alignment is properly for the best. Are you thinking a separate attribute would be the best choice or something entirely different? |
Regarding Description when no Root command exists, the documentation on the class could be extrapolated, no? |
Ah, you're right, it does seem like a good idea to take it from the class documentation! |
@neuecc Here's what my idea was: Default: > MyCLI.exe
Usage: [command] [-h|--help] [--version]
Commands:
kv KeyVault - Manage Azure Key Vault Secrets
kv setup Prompts installs for the nessary cli to interact with Azure KeyVault Hidden, only shown > MyCLI.exe
Usage: [command] [-h|--help] [--version]
Commands:
kv KeyVault - Manage Azure Key Vault Secrets Indented: > MyCLI.exe
Usage: [command] [-h|--help] [--version]
Commands:
kv KeyVault - Manage Azure Key Vault Secrets
└─ setup Prompts installs for the nessary cli to interact with Azure KeyVault |
I see. |
Just stumbled over this while creating CLI tool with sub-commands. From my personal experience I would expect the default behaviour to be that sub-commands are hidden and only shown when the user requests them on the particular level with I agree that this should probably be not configured on a per-(sub-)command basis but on a global level. My first idea would be an enumeration that defines this behaviour and can be set as a static property on the ConsoleApp class (to keep in line with the current pattern of the Framework). |
Hi there 👋
Thanks for creating this awesome framework and putting effort into maintaining it!
I'm currently working on a CLI and using this framework when I stumbled upon a limitation:
When implementing subcommands in ones CLI, it can feel overwhelming and cluttered that all commands including all sub-commands being shown in the help print, when in my opinion, the help should only show first level of the hierarchy. Which is usually the case for CLI's with many commands such as Azure's CLI
az
, which have something called subgroups, which is a group of commands under a command. ConsoleAppFramework should allow to express the this type of hierarchy as well.Related StackOverflow question by Stephen Gilboy:
https://stackoverflow.com/questions/72913198/in-cysharp-consoleappframework-how-can-i-create-a-sub-sub-command
How it is currently
Given:
Produces result:
Notice how the
setup
command is not shown here, even though they start with the same command keyword:How it could look like:
Here below at
Commands:
it could also be calledSubgroups:
or the like. Note: I'm also unsure of how theUsage:
syntax should look like, currently I've just added a|
to indicate or:If able, please let me know if there's any edgecases or something that I havn't considered due to how the framework is structured.
I'll might take a crack at in the next week or so.
The text was updated successfully, but these errors were encountered: