Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

196
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda