dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.63k stars 278 forks source link

Remove toLowerCase calls which cause trouble with certain commands #310

Closed ghost closed 5 years ago

ghost commented 6 years ago

As described in the initial issues #309 the commands are created case-sensitive, but when filtering them toLowerCase is applied to those arguments which causes issues. For a custom command TestCommand (Command._name = "TestCommand") the commands help TestCommand and help testcommand will fail unless you define your custom command explicitly as testcommand since the filter method only matches all Command._names against testcommand.

This forces users to write commands only lower case to assure proper support.

My changes remove those calls and fix case sensitivity issues s.t. the initial example help TestCommand is invoked properly.

It might be reasonable to rewrite the default help command slightly in order to allow case insensitive parameters. (Please don't enforce lower case when creating new commands.)