sindresorhus / meow

🐈 CLI app helper
MIT License
3.53k stars 150 forks source link

Make `isMultiple` non-greedy #162

Closed ulken closed 3 years ago

ulken commented 3 years ago

I.e don't consume more than one argument.

The default behavior of yargs-parser is to greedily consume array flag arguments.

I also realized it doesn't support comma-separated values. Not sure if we want that or not, but I'll make a separate PR and let you be the judge.

Fixes #160

sindresorhus commented 3 years ago

I think we should explicitly document this behavior.

sindresorhus commented 3 years ago

Bump :)

ulken commented 3 years ago

Yeah, sorry. I started looking into it, but then my son woke up 😅

I'll get to it in the coming days.

ulken commented 3 years ago

@sindresorhus Alright. All yours.

voxpelli commented 3 years ago

LGTM 👍

ulken commented 3 years ago

Came to think of: do we want the tests to be as explicit? We have a test for space-separation. Should I add a test for a comma-separated value as well?

I mean, to "document" the (non-)behavior.

ulken commented 3 years ago

Went ahead and added it. Feel free to skip/revert.

sindresorhus commented 3 years ago

Thanks for this 👍🏻