You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The configuration parsing does not seem to know what to do with a non-alphanumeric option, such as -? as a short form of --help. It doesn't look like the definition for help is parsed at all in the following SSCCE:
var Command = require("shon");
var cmd = new Command("serve",{
ip: "[--ip <ipaddr>] IP Address to serve from.",
port: "[-p|--port <port>] :number The Port to serve from.",
help: "[-?|-h|--help]*",
});
var config = cmd.exec();
console.log("RES", config);
if (config === "help") {
console.log("Hello world");
cmd._logUsage();
process.exit(0);
return;
}
Results:
>node server.js -?
usage: serve
[--ip <ipaddr>] IP Address to serve from.
[-p|--port <port>] :number The Port to serve from.
[-?|-h|--help]*
Unexpected flag: "-?"
serve -?
^
>node server.js -h
usage: serve
[--ip <ipaddr>] IP Address to serve from.
[-p|--port <port>] :number The Port to serve from.
[-?|-h|--help]*
Unexpected flag: "-h"
serve -h
^
The text was updated successfully, but these errors were encountered:
The configuration parsing does not seem to know what to do with a non-alphanumeric option, such as
-?
as a short form of--help
. It doesn't look like the definition forhelp
is parsed at all in the following SSCCE:Results:
The text was updated successfully, but these errors were encountered: