-
-
Notifications
You must be signed in to change notification settings - Fork 261
Closed
Description
Describe the bug
When using Commands can't use Option with short name with more than 1 letter.
To Reproduce
Steps to reproduce the behavior:
1.Create main class:
[Subcommand(typeof(SCmd1))]
[Command(Name = "Cmd")]
class Program
{
public static int Main(string[] args)
=> CommandLineApplication.Execute<Program>(args);
public void OnExecute(CommandLineApplication app)
{
app.ShowHelp();
}
}
- Create command class:
[Command("SubCommand1", "SC1")]
class SCmd1
{
[Option(Description = "first option", ShortName = "o1", LongName = "option-1")]
public string Option1{ get; } = null;
public void OnExecute(CommandLineApplication app)
{
...
}
- Run command
Program SC1 -o1 whatever
- Get error
Unrecognized option '-o'
Expected behavior
I would expect to recognize the option "o1" and to set the property "Option1" with the value "whatever".
Screenshots
>JsonSqueezer sqz
Usage: JSONSqueezer squeeze [options]
Options:
-i|--input <INPUT_PATH> Input JSON file to be sqeezed (requiered).
-cf|--custom-fields-path <CUSTOM_FIELDS_PATH> A JSON file with a list of paths to extract to the User extraction path.
>JsonSqueezer sqz -cf EnvironementConfiguration.conf.json -i "Export.json"
Specify --help for a list of available options and commands.
Unrecognized option '-c'
Additional context
Im using version 2.3.3