coa icon indicating copy to clipboard operation
coa copied to clipboard

Problem with parsing opts

Open Yeti-or opened this issue 7 years ago • 1 comments

For example:

program --opt="--one --two"

here we have one option but coa thinks there are three of them

Yeti-or avatar May 29 '17 13:05 Yeti-or

@Yeti-or

I've tried to run this code:

const coa = require('coa');

coa.Cmd()
    .name('ololo')
    .opt('opt').short('o').long('opt').name('opt').title('opt').end()
    .act((opts, args) => {
        console.log(opts, args);
    })
    .run(process.argv.slice(2));

with node this-code.js --opt='--subopt --subopt'

and got:

{ opt: '--subopt --subopt' } {}

Are you sure there is a bug with parsing?

qfox avatar Jul 19 '17 14:07 qfox