coa icon indicating copy to clipboard operation
coa copied to clipboard

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

Open eGavr opened this issue 8 years ago • 1 comments

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'] }

eGavr avatar Apr 26 '16 12:04 eGavr

It's a bug, dude ;-(

qfox avatar Apr 26 '16 18:04 qfox