l3nz / cli-matic

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

Support nil options on sub-command #24

Closed gaberger closed 6 years ago

gaberger commented 6 years ago

I would like the option of executing a sub-command that does not take any options. the use-case might be just to query information.

l3nz commented 6 years ago

You are right, this is something I often do myself. 😄

Anyway, if you have something like:

{:app         {:command     "...."
                 :description "...."
                 :version     "180504.1"}

   :global-opts []

   :commands    [
                  {:command     "noparms"
                  :description "This is a command without parameters"
                  :opts        []
                  :runs        cmd_types}]})

it works with the current version (you need to have an empty vector, and cannot skip the :opts, by design).

Hope you will enjoy CLI-matic!