l3nz / cli-matic

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

Positional parameters #21

Closed l3nz closed 6 years ago

l3nz commented 6 years ago

Why don't we use the same mechanism we use for options to pull positional argument?

Like - instead of:

{:option "pa" :short "a" :as "Parameter A" :type :int :default 0}

we could have

{:option "pa" :short 0 :as "Parameter A" :type :int :default 0}

This would use the first free parameter, store it in "pa" and check it's an int.

Pulled positional arguments remain anyway available in the arguments vector.

Positional arguments are only valid on sub-commands and must appear on the help line.