Closed huytd closed 2 years ago
Oh, nice. I don't know if people expect to have an extra "how" binary when they install how2
I don't think there is a binary named how
existed already in any OS :D so this should be ok?
IMHO only how is too general word :balloon: :smile:
that's nice idea :+1:
Perhaps the solution should be: Ignore a "to" prefex in the question. treat "how2 to install npm" as "how2 install npm" This would allow users to set up an alias "how" = "how2", while sticking to the original binary name.
:+1: for @danielkop's solution that will not take up another bin, which is not a nice practice.
Well. It's a good and safe idea!
How about this: We still based on @danielkop's solution but instead of ignoring to
prefix for all the call, we will check for the first
parameter. Only ignore if it is how
(user aliased). If the first
parameter still matched how2
, we just keep it as it is? :D
Sound like an easter egg :D a hidden feature only work if user do something dirty (create an alias)
// Add support for 'how to' command if (argv['$0'] === 'how') { argv._.splice(0, 1); }
Removes the second word regardless of whether it's "to" or not. So "how npm install" only searches for "install". probably better to make sure argv['$1'].toLowerCase === 'to' before splicing it.
Add a new syntax:
So, from now we have a truth magic in our terminal, for example:
Why? Because... why not? :laughing: