minor bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-08-09 18:23:01 +03:00
parent d571ba1e58
commit b982314015
2 changed files with 5 additions and 2 deletions

View File

@ -939,6 +939,7 @@ object.Constructor('Parser', {
// NOTE: this (i.e. parser) can be used as a nested command/option // NOTE: this (i.e. parser) can be used as a nested command/option
// handler... // handler...
__call__: function(context, argv, main, root_value){ __call__: function(context, argv, main, root_value){
var that = this
var parsed = Object.create(this) var parsed = Object.create(this)
var opt_pattern = parsed.optionInputPattern var opt_pattern = parsed.optionInputPattern
var rest = parsed.rest = var rest = parsed.rest =
@ -998,7 +999,9 @@ object.Constructor('Parser', {
: value) : value)
: value : value
value = value == null ? value = value == null ?
handler.default typeof(handler.default) == 'function' ?
handler.default.call(that)
: handler.default
: value : value
// value conversion... // value conversion...
value = (value != null value = (value != null

View File

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