dthree / vorpal

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

Arguments with `=` (equals sign) in them are parsed incorrectly #354

Closed KorvinSzanto closed 3 years ago

KorvinSzanto commented 3 years ago

A command like foo <password> will incorrectly parse the "password" value when it contains an equals / equal sign: some=password becomes some='password'. You can escape the = to avoid this issue, but the escape gets passed through so you get some\=password.

KorvinSzanto commented 3 years ago

Adding

// @ts-ignore
vorpal.isCommandArgKeyPairNormalized = false

will prevent this behavior: https://github.com/dthree/vorpal/commit/e74bb26535bdbac0544e42774910e6fed1bf67c8

It'd be nice if this were better documented

jianwu commented 3 years ago

Thanks for the answer, I struggled for a while until finding this hidden flag. However, this default behavior is a bit confusing.