[Verb("copy", aliases: new string[] { "cp", "cpy" }, HelpText = "Copy some stuff")]
public class CopyVerb
{
//....
}
You can use verb alias:
$ myprg copy -f file.txt
$ myprg cp -f file.txt # use alias
$ myprg cpy -f file.txt # use alias
New Unparsing Extension method is added: FormatCommandLineArgs to return array of strings.
see wiki
New string extension method SplitArgs to split commandline string with handling double quote with/o keeping the double quote and ignoring the extra spaces in the string.
var myargs="-a xyz --name \"path to file\" -b 123";
string[] args =myargs.SplitArgs(); //return {"-a","xyz","--name","path to file", "-b", "123"}
string[] args =myargs.SplitArgs(true); //keep quote and return {"-a","xyz","--name","\"path to file\"", "-b", "123"}
Allow single dash as a value, now it's allowed: -a - --filename - .
CommandLineParser
v2.9.0-preview1
is releases Today (july 24, 2020) with new features. The package can be downloaded from:C#: https://www.nuget.org/packages/CommandLineParser/2.9.0-preview1 F#: https://www.nuget.org/packages/CommandLineParser.Fsharp/2.9.0-preview1
What is new in that version, read Changelog
The new features:
$ myprog -t value1 -t value2 -t value3
Configure Parser as:You can use verb alias:
FormatCommandLineArgs
to return array of strings. see wikiSplitArgs
to split commandline string with handling double quote with/o keeping the double quote and ignoring the extra spaces in the string.-a - --filename -
.