From ad8debe6e7b36df04b06413a84b640d946f86229 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 29 Dec 2025 23:44:35 +0300 Subject: [PATCH] minor fix... Signed-off-by: Alex A. Naanou --- argv.js | 8 +++++--- package.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/argv.js b/argv.js index 24ef757..d62381f 100644 --- a/argv.js +++ b/argv.js @@ -1080,7 +1080,7 @@ object.Constructor('Parser', { // NOTE: to explicitly handle '-*' option or '*' command define handlers // for them under '-\\*' and '@\\*' respectively. - // Handle unknown otions... + // Handle unknown options... // - deligate to parent if .delegateUnknownToParent is true // - thrwo error delegateUnknownToParent: true, @@ -1447,11 +1447,13 @@ object.Constructor('Parser', { if(rest.length > 0){ var mode = 'explicit' var arg = rest.shift() + var orig = arg // non-string stuff in arg list... if(typeof(arg) != typeof('str')){ unhandled.push(arg) continue } // quote '-*' / '@*'... + // XXX why are we quoting here?? arg = arg.replace(/^(.)\*$/, '$1\\*') var [type, dfl] = opt_pattern.test(arg) ? ['opt', OPTION_PREFIX +'*'] @@ -1460,7 +1462,7 @@ object.Constructor('Parser', { : ['unhandled'] // no handler is found... if(type == 'unhandled'){ - unhandled.push(arg) + unhandled.push(orig) continue } // get handler... @@ -1477,7 +1479,7 @@ object.Constructor('Parser', { || parsed.handler(dfl)[1] // no handler found and '-*' or '@*' not defined... if(handler == null){ - unhandled.push(arg) + unhandled.push(orig) continue } // mark/unmark handlers... diff --git a/package.json b/package.json index da4f9a9..72909d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-argv", - "version": "2.17.1", + "version": "2.17.2", "description": "simple argv parser", "main": "argv.js", "scripts": {