:lambdaisland.cli/sources
is a map from options key
to human readable description of where that key came from, e.g. --foo command line flag
, or positional command line argument idx=0
. See
lambdaisland/config for a use case.clojure.pprint
:coll?
flagopt for flags that can be specified multiple timescli/*opts*
reflects what the main command receives:init
also on nested subcommands, gets merged into top level init.
Flags are processed afterwards, so this is good way to set initial data that
flags can filter/change:exit
key, use that as exit code instead of 1:exit
in the ex-data as exit code (1 otherwise):required
for :flags
-h
can now be used to get help, in addition to --help
cli/*opts*
, for easy access.dispatch
)*opts*
during flag handler execution-
and \\--foo
as positional args:default
and a :handler
for a flag, call the handler
with the default, rather than just assoc-ing it.:default
and a :parse
function for a flag, run the
default value through the parse function, rather than using it directly. Using
the unparsed string form for the default is preferable over for instance using
a keyword, since it leads to better help text rendering.Much expanded and improved version, see README for all details. This is approaching the envisioned scope for this library.
:strict?
mode:handler
and :middleware
on flags:default
and :parse
--flag FOO
and --flag=<foo>
(and --flag <foo>
)-vvv
=> {:verbose 3}
Can you improve this documentation? These fine people already did:
Arne Brasseur & GabrielEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close