Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
Node.js: Command line parsing with mutually exclusive arguments

I thought this should exist but it doesn't seem to be supported in any of the popular command line args parsing libraries.

I want my script to have a set of options that are exclusive of another option.

For example, here I use the -c option

$ node my_script.js -c "foo"

But here, the -c options doesn't make sense because I specified some different options.

$ node my_script.js -b "bar" -n 5

The following should be an error because -c is mutually exclusive to -b and -n

$ node my_script.js -b "bar" -n 5 -c "foo"

I know this exists in Python's argparse. I'm surprised I can't find it in the Node world.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!