commandline
commandline copied to clipboard
Command Line Parser Library
Here is some basic scaffolding code I'm starting with (`CommandLineOptions` is the class that will contain the parsed command-line arguments): ``` /* using CommandLine; namespace SampleNamespace { class CommandLineOptions {...
Here's my options class (its very simple): ``` public class HorizonAppOptions { [Option('s', "SourceFile")] public string SourceFile { get; set; } [Option('i', "Importer", Required = true, HelpText = "Specifies the...
This example is taken straight out of the [documentation](https://github.com/cosmo0/commandline/wiki/Mapping-Properties-To-Options#scalars). Doesn't matter if I explicitly set `CaseSensitive = false` or use the default options, "bye" will not parse to `GreetType.Bye`. However,...
Enum.Parse and Convert.Change type can't convert directly from string to a nullable type so I added a type conversion to the underlying type before parsing/converting takes place. Also added a...
``` [CommandLine.Option('r', "ToggleRefreshRate", Max = 5, DefaultValue = null)] public IEnumerable ToggleRefreshRate { get; set; } ``` causes exception: ``` Unhandled Exception: System.Reflection.CustomAttributeFormatException: 'DefaultValue' property specified was not found. --->...
The command line `myapp -s 60` will fail to parse using the following code: ``` static void Main ( string[] args ) { var result = CommandLine.Parser.Default.ParseArguments(args); if ( result.Errors.Any()...
The HelpOption is not implemented for Version 2.0.
I'm trying to parse a command line that looks like this: `program.exe --arg "-test"` but it returns this error _Option 't' is unknown._ ``` C# using System; using System.Linq; using...
I think it is great to pass in the argument types for the verb options. ``` Type[] argumentTypes = di.GetProcessArgumentTypes(); ParserResult result = Parser.Default.ParseArguments( args, argumentTypes); ``` However, I use...
I'm using verbs with initialization and encountered a strange problem with options via inheritance. ``` public abstract class BaseArguments { [Option('d', "data")] public string Data { get; set; } }...