when I pass this to parseArgs() (using 'import parseArgs from 'minimist';' in an ES6 module'):
[ 'test/TopMenuShort.starbucks' ]
For example, my command line is node myscript.js test/TopMenuShort.starbucks, my "unknown" function is called, and this is output (though I've realized that this line is printed by my "unknown" function):
My work around is to simply return true from my "unknown" function, but that still has the problem that I can't just print the "unknown option" error message. I'm pretty sure that the function should only be called for unknown options, not for non-options on the command line.
Original issue by @johndeighan at https://github.com/substack/minimist/issues/161
when I pass this to parseArgs() (using 'import parseArgs from 'minimist';' in an ES6 module'):
[ 'test/TopMenuShort.starbucks' ]
For example, my command line is
node myscript.js test/TopMenuShort.starbucks
, my "unknown" function is called, and this is output (though I've realized that this line is printed by my "unknown" function):Unknown option: -test/TopMenuShort.starbucks
But the return value from parseArgs() is correct:
My work around is to simply return true from my "unknown" function, but that still has the problem that I can't just print the "unknown option" error message. I'm pretty sure that the function should only be called for unknown options, not for non-options on the command line.