v1.5.0
Features
-
Print custom or default error message when
opts.unknown
finds invalid flags: 922b7e4Example: Custom Output
// demo program sade('sirv') .command('start [dir]') .parse(process.argv, { unknown: arg => `Custom error message: ${arg}` });
# Pass invalid "--foobar" flag $ sirv start --foobar
ERROR Custom error message: --foobar Run `$ sirv --help` for more info.
Example: Default Output
// demo program sade('sirv') .command('start [dir]') .parse(process.argv, { // Pass function, but don't do anything // ~> means we just want validation unknown: () => false });
# Pass invalid "--foobar" flag $ sirv start --foobar
ERROR Parsed unknown option flag(s)! Run `$ sirv --help` for more info.