mirror of
https://github.com/flynx/argv.js.git
synced 2025-10-29 02:40:07 +00:00
notes + minor tweak...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
bad2ea8c6d
commit
622eadee96
7
argv.js
7
argv.js
@ -375,6 +375,13 @@ object.Constructor('Parser', {
|
|||||||
console.log(this.version || '0.0.0')
|
console.log(this.version || '0.0.0')
|
||||||
return module.STOP }, },
|
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???
|
// XXX do we actually need this???
|
||||||
'-': {
|
'-': {
|
||||||
doc: 'stop processing arguments after this point',
|
doc: 'stop processing arguments after this point',
|
||||||
|
|||||||
8
test.js
8
test.js
@ -41,7 +41,6 @@ argv.Parser({
|
|||||||
},
|
},
|
||||||
|
|
||||||
'-test': argv.Parser({
|
'-test': argv.Parser({
|
||||||
// XXX ENV
|
|
||||||
env: 'TEST',
|
env: 'TEST',
|
||||||
default: 'moo',
|
default: 'moo',
|
||||||
}).then(function(){
|
}).then(function(){
|
||||||
@ -97,11 +96,10 @@ p(['test', 'nested', '-h'])
|
|||||||
p(['test', '-h'])
|
p(['test', '-h'])
|
||||||
//*/
|
//*/
|
||||||
|
|
||||||
if(typeof(__filename) != 'undefined'
|
typeof(__filename) != 'undefined'
|
||||||
&& __filename == (require.main || {}).filename){
|
&& __filename == (require.main || {}).filename
|
||||||
|
&& p()
|
||||||
|
|
||||||
p(process.argv)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user