l3nz / cli-matic

Compact, hands-free [sub]command line parsing library for Clojure.
Eclipse Public License 2.0
360 stars 28 forks source link

[Ftr] add an option to collect rest of positional arguments into a collection #137

Open drewverlee opened 3 years ago

drewverlee commented 3 years ago

Is your feature request related to a problem? Please describe. I need to be able to supply O to N number of positional required arguments and ideally they would be handled similarly to the other options.

Describe the solution you'd like From a user perspective this would look like providing an options map with a key :rest true. or maybe :short :rest sense :short is also used to handle positional arguments. This would configure it so all positional inputs past those given in the other shorts would be put into this collection.

Describe alternatives you've considered I coerce and validate the arguments value in the function, but that would seem to defeat the purpose of the configuration map that provides clarity on how things are handled.

l3nz commented 2 years ago

Do you think https://github.com/l3nz/cli-matic/issues/149 would be a solution?

drewverlee commented 2 years ago

I believe so, though it's been a while since i encountered the issue. #149 looks like a good enchantment.