nomnom icon indicating copy to clipboard operation
nomnom copied to clipboard

Required positional arguments are not checked

Open orospakr opened this issue 11 years ago • 1 comments

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

orospakr avatar Jul 25 '14 02:07 orospakr

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();

madebyherzblut avatar Jun 01 '15 08:06 madebyherzblut