reworked how the bool option type works + now --quiet is a bool...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-01-17 17:46:49 +03:00
parent 6f76720330
commit d6866ae4b2
2 changed files with 8 additions and 3 deletions

View File

@ -323,7 +323,8 @@ object.Constructor('Parser', {
true true
: v == 'false' ? : v == 'false' ?
false false
: !!v }, //: !!v },
: true },
int: parseInt, int: parseInt,
float: parseFloat, float: parseFloat,
number: function(v){ return new Number(v) }, number: function(v){ return new Number(v) },
@ -943,7 +944,11 @@ object.Constructor('Parser', {
'-quiet': { '-quiet': {
priority: 70, priority: 70,
doc: 'quiet mode', doc: 'quiet mode',
default: true, }, // XXX test if this prevents us to set the option...
// ...the handler can't destingwish whether it was called
// with the default or the user-passed value...
//default: true,
type: 'bool', },
// Stop argument processing... // Stop argument processing...

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-argv", "name": "ig-argv",
"version": "2.16.3", "version": "2.16.4",
"description": "simple argv parser", "description": "simple argv parser",
"main": "argv.js", "main": "argv.js",
"scripts": { "scripts": {