cmd-args
A simple command-line argument parser for NodeJS command-line tools.
Install:
$ npm install cmd-args
example:
myParser.run
example run:
$ my-cmd --version
outputs:
v1.0.0
example run:
$ my-cmd --help
outputs:
My CMD
my-cmd description...
Usage:
my-cmd [OPTIONS] --help
OR
my-cmd [OPTIONS] <input-files>...
my-cmd [OPTIONS]:
--version Prints version of this command.
--help Prints help text for this command.
-v, --verbose Enable verbose mode.
-o, --output-file[=ARG] Specifies location to write the output file. If not set the output will go to stdout.
ARGUMENTS:
input-files=ARG+ List of input files to be used.
example run:
$ my-cmd file1 file2
outputs:
example run:
$ my-cmd file1 file2 -o file-out
outputs:
example run:
$ my-cmd file1 file2 --output-file file-out
outputs:
example run:
$ my-cmd -v file1 file2 --output-file file-out
outputs: