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
: v == 'false' ?
false
: !!v },
//: !!v },
: true },
int: parseInt,
float: parseFloat,
number: function(v){ return new Number(v) },
@ -943,7 +944,11 @@ object.Constructor('Parser', {
'-quiet': {
priority: 70,
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...

View File

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