Hide specific CommandOptions in help text #629
twaalewijn
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Since we already have the ability to hide commands, I see no reason not to implement a feature to hide options as well. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to propose expanding the
CommandOption
attribute to include a setting to hide it from the help text.For example through something like the following code:
This would only be available for
CommandOption
, since hidingCommandArgument
(which I believe is always positional) would be a bad idea in my opinion.Context
I have been porting a few commandline applications at the company I work for to Spectre.Console from commandlineparser.
One of these apps is basically used to execute a bunch of SQL scripts against the database of a product.
However, the CLI app is maintained by a different team than the one making/updating the scripts.
So lets say
Script team
maintains the scripts andCLI team
maintains the CLI app.Since this CLI app is also released to clients/users of the product,
CLI team
simply embeds the script files approved byScript team
into the dll/exe for each release.To let
Script team
test changes to their scripts,CLI team
added a bunch of hidden options to execute script files from a specific directory instead of the embedded ones.These hidden options are not meant to be used by the clients/users of the product so the
CLI team
wants them hidden but it has happened before that theScript team
wanted to have hotfix tested by a certain client.This was then done by just sending them the updated scripts and have them use the hidden options to run those scripts instead of the embedded ones.
So ideally the
CLI team
wants to keep these options hidden in the help text but still available to call when running the app so both teams can more or less do their thing without waiting on the other team.Workaround
I guess the
CLI team
from the context story could just add a separate command with the extra options in them and hide that instead but I think that would mean having to maintain a different command class and settings just to hide part of a command.Which is not the end of the world but it would be slightly annoying in my opinion.
I would be willing to help implement this feature if it gets approved.
And if not then I am fine to just settle for the current workaround as well.
Beta Was this translation helpful? Give feedback.
All reactions