mattdesl / budo

:clapper: a dev server for rapid prototyping
MIT License
2.18k stars 106 forks source link

Support subarg syntax in the CLI #156

Closed quantizor closed 7 years ago

quantizor commented 8 years ago

Flags like -d allow for array input, but you can only provide a single string via the CLI. I'd recommend using subarg syntax, which was pioneered by Browserify and is in use there. https://github.com/substack/subarg

Then it could look like this:

budo entry.js -d [ src dist ]

And be transformed into opts.dir = ['src', 'dist']

mattdesl commented 8 years ago

You can currently just pass the flag multiple times if you'd like an array of directories:

budo entry.js -d src -d dist

Subarg is already being used after the -- flag for browserify arguments. Supporting subarg in budo options would need to be done in a way that doesn't break that. :smile:

mattdesl commented 7 years ago

I've added subarg to budo, but the way it works is that it doesn't treat -d [ foo bar] the same as -d foo -d bar. In the interest of keeping scope creep and complexity to a minimum, I think I will pass on this option since it's not too hard to just define the flag twice for multiple directories. Thanks!