From f204f02d6574a8e2dd2a541d3292cb410d768e4a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 24 Aug 2020 01:52:11 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- argv.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/argv.js b/argv.js index f46589c..d459f7b 100644 --- a/argv.js +++ b/argv.js @@ -922,11 +922,13 @@ object.Constructor('Parser', { // // .onArgs(callback(args)) // - // .onNoArgs(callback()) + // .onNoArgs(callback(args)) // + // + // NOTE: args is mutable and thus can be modified here affecting + // further parsing. onArgs: afterCallback('onArgs'), onNoArgs: afterCallback('onNoArgs'), - // Post-parsing callbacks... // @@ -999,6 +1001,7 @@ object.Constructor('Parser', { script.length - parsed.scriptName.length) // call the pre-parse handlers... + // NOTE: these can modify the mutable rest if needed... rest.length == 0 ? this.onNoArgs(rest) : this.onArgs(rest)