0

https://www.npmjs.com/package/minimist

For some keys I want to be able pass actual variables of them instead:

$ node my_script.js --var1 a --var2 b --var3 c

===>

$ node my_script.js --var1 a --b --var3 c
$ node my_script.js --var1 a --b1 --var3 c
$ node my_script.js --var1 a --b2 --var3 c

Where (b, b1, b2, ... bN) -- is a predefined set of constants.

How to do it? Is it possible at all?

mondichuk
  • 77
  • 1
  • 5
  • `--b`, `--b1` and `--b2` are essentially independent boolean flags. Interpreting them as values for a `var2` variable (and handling the cases where none or multiple of them are supplied) needs to be done by your application, that's out of scope for minimist. – Bergi Apr 15 '23 at 21:10

0 Answers0