Default help command does not support commands that are not entirely lower case
opened this issue · comments
I am using your library in a custom project which does not adhere to usual UNIX standards when naming the commands. It uses commands akin to PowerShell commandlets as in Write-Output
. I wanted to rename help
to Get-Help
with a custom hook (either using mock
or manually overriding Module.prototype.load
) which had some since Get-Help Write-Output
would not print the expected help for the particular Write-Output
command.
After reverting my rename it turns out with your default help Write-Output
the output is still Invalid command
. After looking through the code for far too long it turns out that this line the culprit:
Line 27 in 2073ad9
Your default help
command is calling toLowerCase
on the argument and then looking for a write-output
command. However debugging yields that the name of the command is not altered when creating it and still being Write-Output
.
In order to fix this it is only necessary to remove the linked call toLowerCase
. Unfortunately there are still two occurences of it:
Line 892 in 2073ad9
Line 1091 in 2073ad9
I haven't figured out what they are exactly doing and whether my first change will break something. Once I know more and was able to test the change I am considering to open a pull request to fix this.