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:
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:
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.
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 renamehelp
toGet-Help
with a custom hook (either usingmock
or manually overridingModule.prototype.load
) which had some sinceGet-Help Write-Output
would not print the expected help for the particularWrite-Output
command.After reverting my rename it turns out with your default
help Write-Output
the output is stillInvalid command
. After looking through the code for far too long it turns out that this line the culprit:https://github.com/dthree/vorpal/blob/2073ad9d77b02a05b86f122ef473a10f164e43ba/lib/vorpal-commons.js#L27
Your default
help
command is callingtoLowerCase
on the argument and then looking for awrite-output
command. However debugging yields that the name of the command is not altered when creating it and still beingWrite-Output
.In order to fix this it is only necessary to remove the linked call
toLowerCase
. Unfortunately there are still two occurences of it:https://github.com/dthree/vorpal/blob/2073ad9d77b02a05b86f122ef473a10f164e43ba/lib/vorpal.js#L892
https://github.com/dthree/vorpal/blob/2073ad9d77b02a05b86f122ef473a10f164e43ba/lib/vorpal.js#L1091
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.