Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Required positional arguments are not checked #45

Open
orospakr opened this issue Jul 25, 2014 · 1 comment
Open

Required positional arguments are not checked #45

orospakr opened this issue Jul 25, 2014 · 1 comment

Comments

@orospakr
Copy link

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
@madebyherzblut
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants