l3nz / cli-matic

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

Perhaps clarify that subcommands are required #98

Closed KingMob closed 4 years ago

KingMob commented 4 years ago

Is your feature request related to a problem? Please describe. Many CLI tools don't require subcommands, and the docs weren't clear that cli-matic does. I went searching on Clojurians, and found someone with the exact same question, so fwiw, that's two confused people.

Describe the solution you'd like The README should be clear on this point. It could say subcommands are required, or that there's no support for :runs at the top-level of the config, or under :app. The {:app {:command ... map is a bit confusing on this point, because it other wise resembles the subcommands, suggesting that it might be possible.

Describe alternatives you've considered Code could be written to support a toplevel command that runs with no subcommand.

adam-krieg commented 4 years ago

It would be great if you could specify a default subcommand so that if none was given, would just use that subcommand.

l3nz commented 4 years ago

As per bug #69 we plan to have a "tree" of subcommands; so you can have either just one, or a tree of subcommands.

l3nz commented 4 years ago

After v0.4.0, using the new configuration syntax, subcommands are not required anymore.

See example in toycalc-nosub.clj