IgnoreCase when using slash and other questions

Nov 5, 2014 at 3:58 PM

1) It seems that the IgnoreCase option doesn't work when using slash for notation.

I have defined the following argument:

[SwitchArgument('i', "init", false, Description = "Initializes the component by checking and copying configuration files")]
public bool Init { get; set; }

The call to MyApp.exe /Init fails, while /init, -init and -Init work. Can you reproduce that? Is that a bug or is something wrong in my code?

2) Arguments, that are passed, but not specified in my options class cause the parsing process to fail, but not error is thrown.

MyApp.exe C:\AnyPath\program.exe -init

Parsing succeeds, but the Init property isnt set to True, as it should according to the SwitchAttribute (see 1). After removing the first argument (path) from the call it works, but I wan't to allow additional arguments, that are not (yet) defined in my arguments class. Can't they simply be ignored from the command line parser? Is there any switch to set.

3) It is possible to use the compiled version of the library in a commercial product, right? Do I have to consider something special?
Feb 21, 2016 at 9:40 PM
1) This issue has been addressed in v3 which you now can get from NuGet.

2) The behaviour you describe is supported by the library with one limitation - the arguments with "-" (or "--") prefix must come first. In your case, that would be

MyApp.exe --init C:\AnyPath\program.exe

Where "C:\AnyPath\program.exe" would be recognized as "additional argument". Please check https://github.com/j-maly/CommandLineParser/wiki/Command-line-format#user-content-additional-arguments for more information.

Also, you have to have --init instead of -init.

The project has been migrated to GitHub, please use it for tracking the project, getting information about new releases & reporting all potential issues.