npm install commander-parser

A command-line parser for node.js like python's argparser, inspired by commander.js.
``javascript`
var command = parser().command(
`javascript`
parser().argument(
"narg":
"required":
"dest":
"const":
"type":
})
`javascript`
parser().option(
"action":
"required":
"dest":
"const":
"type":
})
parser().command(, );
`Methods
$3
Return an instance of parser.Parser.
*
name: The name of the program(default: process.argv[1])
$3
Create a new Parser object.
*
name: The name of the program(default: process.argv[1])$3
*
name: The name of the Action.*
handler: The handler of the Action. arguments: handler arguments.
*
value: raw value.
* memo: dest memo.
* options: options.$3
*
name: The name of the Type.*
handler: The handler of the Type. arguments: handler arguments.
*
value: raw value.
* error: error handler.
* options: options.Parser() Methods$3
Return parser.
*
usage: The string describing the program usage(default: generated from arguments added to parser)$3
Return parser.
*
description: The string describing the program.$3
Return parser.
*
addition: Additional messages of the program.
$3
Return parser.
*
name: The name of the argument.
* help: The string describing the argument.
* options: Other options.
* narg: How many arguments of type type should be consumed when this option is seen. If > 1, parser will store a array of values to dest.(default: 1)
* required: The value is required.
* default: The value to use for this argument’s destination if the argument is not seen on the command line.
* dest: This tells parser where to write it.
* type: The argument type expected (e.g., "string" or "int"); the available types are ["int", "float", "string", "choice", ].You can registry custom types by parser.type.
* choices: For options of type "choice", the list of strings the user may choose from.
$3
Return parser.
*
flag: The flags of the option.
* help: The string describing the option.
* options: Other options.
* action: Determines parser‘s behaviour when this option is seen on the command line; the available options are ["store", "store_const", "store_true", "store_false", "append", "append_const", "count"].(default "store") You can registry custom actions by parser.action.
* required: The value is required.
* default: The value to use for this argument’s destination if the argument is not seen on the command line.
* dest: This tells parser where to write it.
* type: The argument type expected (e.g., "string" or "int"); the available types are ["int", "float", "string", "choice", ].You can registry custom types by parser.type.
* const: For actions that store a constant value, the constant value to store.
* choices: For options of type "choice", the list of strings the user may choose from.$3
Return command parser.
*
name: The name of the command.
* help: The string describing the command.$3
Print parser's usage.
$3
Return parser.
*
function: This function will be called when calling parser.parse.* arguments:
* options: The parsed command-line options.
$3
parse command-line options
*
argv: command-line argvs with ["node",