Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda