Skip to content

No warning when incorrect options are passed with changed parameters order #125

@GoalSmashers

Description

@GoalSmashers

Let's take the following code (assume file is named demo.js).

#!/usr/bin/env node

var commands = require('commander');

commands
  .option('-t, --test <value>', 'Just testing')
  .parse(process.argv);

Let's try to run it:
./demo.js --test 5 - no errors
./demo.js --test 5 demo.js - no errors
./demo.js --test 5 --test2 demo.js - unknown option '--test2'
./demo.js demo.js --test 5 --test2 - no errors

Apparently extra arguments where added at the beginning suppress errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions