veged / coa

Command-Option-Argument: Get more from defining your command line interface
MIT License
144 stars 22 forks source link

Bug in case of creating options via methods '.arr()' + '.def()' #58

Open eGavr opened 8 years ago

eGavr commented 8 years ago

Hi!

I'm using coa in my-script.js this way:

require('coa').Cmd()
    .name(process.argv[1]).title('Makes awesome things').helpful()
    .opt()
        .name('awesomeOpt')
        .title('My awesome option')
        .long('awesome-opt')
        .arr()
        .def(['1', '2'])
        .end()
    .act(opts => console.log(opts))
    .run();

Then I run my script:

$ node my-script.js

The output is:

{ awesomeOpt: [['1', '2']] }

but I expected:

{ awesomeOpt: ['1', '2'] }
qfox commented 8 years ago

It's a bug, dude ;-(