Comparing version 0.2.2 to 0.2.3
# Changes | ||
## 0.2.3 | ||
* `printHelp()` function is available again into `getopt()` response object. | ||
* `-h` is not a reserved key any more. You can use it in your options. | ||
## 0.2.2 | ||
@@ -4,0 +9,0 @@ |
@@ -227,7 +227,2 @@ 'use strict'; | ||
// Help option is reserved | ||
if (key === 'h') { | ||
throw new Error('Trying to use reserved short key "h" in option "' + option + '". This key is reserved for the help message.'); | ||
} | ||
// Short options name has to be unique | ||
@@ -246,3 +241,3 @@ if (usedKeys[key]) { | ||
// Print help message when executing with --help or -h | ||
if (argv.indexOf('--help') !== -1 || argv.indexOf('-h') !== -1) { | ||
if (argv.indexOf('--help') !== -1) { | ||
printHelpMessage(config, helpTail, programName); | ||
@@ -293,2 +288,7 @@ process.exit(0); | ||
// A function to print help message manually | ||
cmdOptions.printHelp = function () { | ||
printHelpMessage(config, helpTail, programName); | ||
}; | ||
return cmdOptions; | ||
@@ -304,2 +304,3 @@ } | ||
console.log('USAGE:', helpTail); | ||
console.log('The following options are supported:'); | ||
@@ -306,0 +307,0 @@ var o = null, lines = [], maxLength; |
@@ -24,1 +24,5 @@ /** _ _ _ | ||
exports.readByLines = reading.readByLines; | ||
// Progress bar | ||
var progress = require('./lib/progress.js'); | ||
exports.progressBar = progress.progressBar; |
{ | ||
"name": "stdio", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Standard input/output management with NodeJS", | ||
@@ -5,0 +5,0 @@ "keywords": ["input", "console", "output", "terminal", "system", "arguments", "cli"], |
@@ -102,3 +102,3 @@ Module for standard input/output management with nodejs. | ||
This module generates a descriptive usage message automatically. You'll see it when your program is called with `-- help` option (or its short version `-h`), which is automatically supported. The following code: | ||
This module generates a descriptive usage message automatically. You'll see it when your program is called with `--help` option, which is automatically supported. The following code: | ||
@@ -133,2 +133,4 @@ ```javascript | ||
You can print the help message manually if you want, executing `ops.printHelp()`. | ||
### 2.2. Read standard input at once | ||
@@ -135,0 +137,0 @@ |
# TODO | ||
- [ ] Recover printHelp() function | ||
- [ ] Support enumerated options. Help must say something like --whatever <something|another|last> | ||
@@ -4,0 +5,0 @@ - [ ] Support mandatory extra args |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34214
740
194