How can I define a shorthand alias for a boolean yargs option that negates the option?

Viewed 216

Let's say I want to pass my (yargs-enabled) script a boolean option:

./foo --secure-but-slow=false

secure-but-slow should default to true, so only users who know what they're doing choose the insecure option. However, it would be nice for power users to have a shortcut short-option flag, e.g.

./foo -i 

What's the right way to tell yargs that -i should set --secure-but-slow=false?

0 Answers
Related