node-getopt
node-getopt copied to clipboard
Featured command line options parser.
Build complains about (node:24) [DEP0128] DeprecationWarning: Invalid 'main' field in '/home/container/node_modules/node-getopt/package.json' of './lib'. Please either fix that or report it to the module author
also add a test script
There is a bad value in the `package.json` file that causes the application to print an error message at every start: ``` (node:8) [DEP0128] DeprecationWarning: Invalid 'main' field in '/usr/local/lib/node_modules/@alo5/availability/node_modules/node-getopt/package.json'...
This pull request fixes #20
Currently this library does not have good error messages by default. For example, the example program: ```js const getopt = require('node-getopt'); const info = getopt.create([ ['t', 'test=ARG', 'Test'] ]).bindHelp().parseSystem(); ```...
It would be helpful if I could access the command-name (the basename of `process.argv[1]`) from the opts structure, so I can use it in other error messages. Something like: ```...
The help message that's autogenerated from the options is of the form ``` Usage: node myprog [OPTION] Options: -v, --verbose Verbose mode [etc.] ``` But often the usage of myprog...
1) Ability to make options required: Example: the --tel option is required (not just the argument) myapp.js --tel=555-555-1234 2) Also required ARGs should remove 1st = and alltrim(spaces) of argument...
Best I can tell there is no way to specify that a short option should have an argument. I've tried the following: This errors: ``` opts = getopt.create([ ["d=ARG"] }).parseSystem();...
It'll be good to have :+1: