Open BlackPhlox opened 3 months ago
Thank you, I agree that this feature is necessary! Regarding the display of help, I am using Cocona as a reference, so I think it would be good if we can have a similar display. https://github.com/mayuki/Cocona
The current problem is that when a Root command does not exist, there is no way to set the Description for the Group. Also, we may not want to add too many features to the CommandAttribute.
@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! As for the Attribute, I think a separate one would be better, but in the first place, I don't really understand what the CommandType is supposed to indicate.
@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 setup
when calling > MyCLI.exe kv setup
:
> 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. I don't think it's a good idea to configure on a per-command basis. If you want to be able to configure it, the whole thing should be default or hidden, I guess.
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 --help
.
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.