Argparse error using NodeJS

Joined
Oct 31, 2022
Messages
1
Reaction score
0
Hello everybody,

I am doing a Node JS project and need to use the argparse module to parse arguments. I call for the parser like this :
JavaScript:
var parser = new ArgumentParser()
parser.add_argument(<argument>)
var args = parser.parse_known_args()
console.log(args)
Problem is, when my parser encounter an unknown argument it exits the function and shows me the help message. I would like to know how to fix it. I have read that this was a common error in Python which was fixed using :
Python:
args, uknownargs = parser.parse_known_args()

But how can I fix it in node JS ?

Thank you for your help !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top