Commandline: Is it possible to use case insensitive with Verbs?

Created on 4 Nov 2017  路  4Comments  路  Source: commandlineparser/commandline

Issue by pduer
_Tuesday Apr 25, 2017 at 13:41 GMT_
_Originally opened as https://github.com/gsscoder/commandline/issues/439_


Since verbs are defined as attributes before classes, can you still use case insensitivity?

Most helpful comment

Comment by JeremyMorton
_Tuesday Aug 22, 2017 at 22:40 GMT_

When creating the Parser, alter the settings to turn off case sensitivity.

      var parser = new Parser(settings =>
      {
        settings.CaseSensitive = false;
      });

With version 2.4.3.0 I tried replacing:

var parser = Parser.Default;

by the above code, but it wasn't enough. By spelunking I discovered that I also had to set:

settings.HelpWriter = Console.Error;

I would have expected the above code to return a parser whose settings were identical to Parser.Settings.Default except those specifically modified by the Action<ParserSettings>.

All 4 comments

Comment by KomAuras
_Friday Jul 21, 2017 at 07:01 GMT_


+1 for feature

Comment by JeremyMorton
_Tuesday Aug 22, 2017 at 22:40 GMT_


When creating the Parser, alter the settings to turn off case sensitivity.

      var parser = new Parser(settings =>
      {
        settings.CaseSensitive = false;
      });

Comment by pduer
_Wednesday Aug 23, 2017 at 11:50 GMT_


Wow, yeah that will do the trick!

I really like this library, wish I knew what to contribute to make it better!

Comment by JeremyMorton
_Tuesday Aug 22, 2017 at 22:40 GMT_

When creating the Parser, alter the settings to turn off case sensitivity.

      var parser = new Parser(settings =>
      {
        settings.CaseSensitive = false;
      });

With version 2.4.3.0 I tried replacing:

var parser = Parser.Default;

by the above code, but it wasn't enough. By spelunking I discovered that I also had to set:

settings.HelpWriter = Console.Error;

I would have expected the above code to return a parser whose settings were identical to Parser.Settings.Default except those specifically modified by the Action<ParserSettings>.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IB38 picture IB38  路  4Comments

Silverwing1983 picture Silverwing1983  路  4Comments

TheNybbler picture TheNybbler  路  3Comments

ericnewton76 picture ericnewton76  路  3Comments

Eason-Lian picture Eason-Lian  路  3Comments