D
D
Dark Hole2017-02-12 16:50:31
Command line
Dark Hole, 2017-02-12 16:50:31

Module/library to work with command line arguments?

It is quite easy to work with command line arguments, but the code "spoils" from such ugly constructions:

let input = process.argv.indexOf('-i');
if(input < 0) throw error;
input = prcess.argv[input + 1];

Although it is quite working, it is not optimized and ugly. And I don’t feel like sawing my crutches, when this has probably already been done.
The question is simple. What modules/libraries are there in general and which ones do you use or recommend :)
PS I'm also interested in libraries for C++, that's why it got into the tags.
PPS And how to force bash to do addition on tabs of the combinations?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Damir Makhmutov, 2017-02-13
@abyrkov

https://github.com/yargs/yargs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question