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

188
Views
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
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!