-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
Add the ability to hide CommandOptions #631
Comments
@nils-a I basically have this working now. I do have some minor things I would like feedback on before submitting the PR.
Did I miss anything else regarding those commands and is the behavior I summarized above correct?
Just use a public setter since it is only an optional property inside of an attribute anyway: public bool IsHidden { get; set; } Or make it part of the constructor instead with a default value: public bool IsHidden { get; }
public CommandOptionAttribute(string template, bool isHidden = false)
{
IsHidden = isHidden;
}
// Usage
[CommandOption("--foo", true)]
[CommandOption("--foo", isHidden: true)] Personally I would just go with the public setter since, for attributes, I would only expect required parameters to be on the constructor itself but maybe you would think differently about that to keep the property itself read only like the rest of them. On a side note: The However I almost accidentally changed the encoding of a bunch of files just by opening them in Visual Studio and I also did not initially notice that all the files are using just I would recommend adding stuff like that to the [*.cs]
end_of_line = lf
# This is is what VS2022 itself uses when you create a new '.NET' editorconfig file
charset = utf-8-bom |
Sounds good to me. If you missed something, I did, too. 😄
Yes, so would I.
That's kind of strange. Are you using a non-default setting for So, setting |
CommandOptions now has an IsHidden property that, when set to true, will cause the option to be hidden from the following cases: - Help text using `-h|--help` - Xml representations generated with the `cli xml` command - Diagnostics displayed with the `cli explain` command Hidden options can still be outputted with `cli explain` using the `--hidden` option that is also used to display hidden commands. Fixes spectreconsole#631
My apologies, the whole I have created the PR for this feature now. |
CommandOptions now has an IsHidden property that, when set to true, will cause the option to be hidden from the following cases: - Help text using `-h|--help` - Xml representations generated with the `cli xml` command - Diagnostics displayed with the `cli explain` command Hidden options can still be outputted with `cli explain` using the `--hidden` option that is also used to display hidden commands. Fixes #631
Is your feature request related to a problem? Please describe.
Coming from #629, it would be good to have the ability to hide
CommandOptions
.Describe the solution you'd like
Something like
Additional context
See #629
The text was updated successfully, but these errors were encountered: