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

197
Vistas
Can command line argument differentiate between a correct option such as --user and an incorrect option -user?

Basically I have defined all the options in const optionDefinations say = [ { name: 'user', alias: 'u', type: String }];

But when I give the option as -user instead of --user in terminal. It is throwing an exception as ALREADY_SET If a user sets a singular, non-multiple option more than once. The err.optionName property contains the option name that has already been set,

I tried parsing using stopAtFirstUnknown and partial true it didn't work.Here is the github link of the documentation (https://github.com/75lb/command-line-args/blob/master/doc/API.md)

Can i give an echo message "as error" instead of the exception?

about 4 years ago · Juan Pablo Isaza
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