l3nz / cli-matic

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

Add :multiple tag for options #1

Closed l3nz closed 6 years ago

l3nz commented 6 years ago

If an option is tagged as :multiple true, then it is actually a vector of all parameter invocations.

     cmd sub --a 1 --a 2 --a 3

where :a is tagged as :multiple, should get you

      {:a [1 2 3]}

In the order they are passed.

l3nz commented 6 years ago

Now if you specify ":multiple true", results are returned as a vector (in any case); all values passed are added to the vector and returned in order.

E.g.

 cmd foo --val abcd  --val defg

will return:

  {:commandline  {:_arguments []
                  :val        ["abcd" "defg"]}

Tests created and version bumped to 0.1.1.