nomnom
nomnom copied to clipboard
Required positional arguments are not checked
However, their indication with <param> rather than [param] does still work.
#!/usr/bin/env node
var nomnom = require("nomnom");
nomnom.command("go")
.help("Do a thing")
.options({
"important": {position: 0, required: true, help: "I'm required!"}
});
nomnom.parse();
./script.js go # prints no error
I just ran into this as well and it seems that the command is at position 0. So if you use position 1 it works as expected:
#!/usr/bin/env node
var nomnom = require("nomnom");
nomnom.command("go")
.help("Do a thing")
.options({
"important": {position: 1, required: true, help: "I'm required!"}
});
nomnom.parse();