diff --git a/argv.js b/argv.js index 435b672..8d5288b 100644 --- a/argv.js +++ b/argv.js @@ -375,6 +375,13 @@ object.Constructor('Parser', { console.log(this.version || '0.0.0') return module.STOP }, }, + // Stop processing arguments and continue into .then(..) handlers... + // + // If .then(..) does not handle rest in the nested context then this + // context will be returned to the parent context, effectively + // stopping the nested context and letting the parent continue. + // + // XXX should we be able to force the parent/root to also stop??? // XXX do we actually need this??? '-': { doc: 'stop processing arguments after this point', diff --git a/test.js b/test.js index b9f581c..cfc9c18 100644 --- a/test.js +++ b/test.js @@ -41,7 +41,6 @@ argv.Parser({ }, '-test': argv.Parser({ - // XXX ENV env: 'TEST', default: 'moo', }).then(function(){ @@ -97,11 +96,10 @@ p(['test', 'nested', '-h']) p(['test', '-h']) //*/ -if(typeof(__filename) != 'undefined' - && __filename == (require.main || {}).filename){ +typeof(__filename) != 'undefined' + && __filename == (require.main || {}).filename + && p() - p(process.argv) -} /**********************************************************************