You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow new HelpOption("--help") without aliases #2117
Now that #2102 in System.CommandLine 2.0.0-beta4.23172.1 made System.CommandLine.Help.HelpOption public, it would be handy if I could create an instance of HelpOption by using just new HelpOption("--help") rather than new HelpOption("--help", aliases: null). That could be implemented in any of the following ways:
new constructor: public HelpOption(string name)
optional parameter: public HelpOption(string name, string[]? aliases = null)
params: public HelpOption(string name, params string[] aliases). That would be consistent with the Option<T> constructor.
I don't like using new HelpOption("--help", null) with an unnamed null argument because its purpose would not be immediately obvious to people reading the code. new HelpOption("--help", Array.Empty<string>()) is quite clear too but more verbose than a named argument.
(System.CommandLine.Help.VersionOption is not public yet.)
Activity