75lb / command-line-args

A mature, feature-complete library to parse command-line options.
MIT License
679 stars 107 forks source link

Allow Special Characters #98

Closed heychazza closed 5 years ago

heychazza commented 5 years ago

Hi there,

When attempting to pass special characters (such as $, !, @ etc), it gets stripped out of the string.

For example: node app.js -p "qwerty$123"

Shows: { password: 'qwerty23' }

This also happens when trying to input '@', any fix?

Config Options:

    {
        name: 'password',
        alias: 'p',
        type: String,
        description: 'The password for the target account',
        typeLabel: '<password>'
    },

Thanks.

75lb commented 5 years ago

are you on Linux or Mac? If so pass this command instead (notice the single quotes):

node app.js -p 'qwerty$123'

Don't forget chars like $ and @ have special meaning in the *nix shell.

heychazza commented 5 years ago

are you on Linux or Mac? If so pass this command instead (notice the single quotes):

node app.js -p 'qwerty$123'

Don't forget chars like $ and @ have special meaning in the *nix shell.

Hey there, yep that fixed it - my bad.

I didn't know such a minor difference can do so much, I appreciate the quick reply!