testing...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-07-20 03:05:11 +03:00
parent 73e1f82c5e
commit fd2eb0e0ed
2 changed files with 10 additions and 13 deletions

18
argv.js
View File

@ -187,29 +187,21 @@ function(name, pre, post){
//
//
//
// NOTE: currently any "argument" that passes the .optionInputPattern test
// is handled as an option, no matter what the prefix, so different
// prefixes can be handled by the handler by checking the key argument.
// currently both '-' and '+' are supported.
//
// NOTE: essentially this parser is a very basic stack language...
// XXX can we implement the whole thing directly as a stack language???
//
//
// XXX FEATURE: handle <scriptName>-<command> script calls...
//
// XXX FEATURE (DELAYED): handle <scriptName>-<command> script calls...
// XXX FEATURE (DELAYED): read metadata from package.json...
// ...not clear which package json to get, needs more thought...
// XXX FEATURE (DELAYED): handle multiple values per flag...
// ...manually this is trivial, automating it would complicate things,
// will think about it when we need this feature more than once...
// XXX FEATURE (DELAYED): multiple prefixes, like '+' and the like...
// ...one way to do this manualy now is to set the appropriate
// .optionInputPattern and handle the arg in the handler itself...
// ...not sure yet how to automate this:
// - prefix handler -- pass the prefix to a special handler and
// it decides what to do...
// -help -> this.handlePrefix('-', ...)
// - option prefix derived from arg prefix i.e.
// -help -> this['-help'](..)
// +help -> this['+help'](..)
//
//
// XXX add support for ParserError exception handling...
// XXX should -help should work for any command? ..not just nested parsers?

View File

@ -46,6 +46,11 @@ argv.Parser({
required: true,
},
'-prefix': {
doc: 'prefix test',
handler: function(opts, key, value){
console.log('PREFIX:', key[0]) }, },
'-value': {
doc: 'Value option',
arg: 'VALUE | valueValue',