For breaking changes, check here.
Babashka CLI: turn Clojure functions into CLIs!
pom.xml
and project.clj
for cljdoc:collect
option to support custom transformation of arguments to collections (@lread)format-table
correctly pads cells containing ANSI escape codesFix #89: long option never represents alias
Fix #82: prefer alias over composite option
:opts
to :error-fn
input--dirs
, --only
, etc--no-option
(--no
prefix) in combination with subcommands:exec-args
over spec :default
sdispatch
improvements (@Sohalt, @borkdude):
:cmds
order of entries in the table doesn't matterfoo --opt1=never bar --opt2=always
-X
and -T
behavior-abc
=> {:a true :b true :c true}
--no-
prefix for negative flags: --no-colors
=> {:colors false}
auto-coerce
: coerce "nil"
to nil
(@teodorlu)auto-coerce
for keywords (@teodorlu)babashka.exec
compatible with clojure CLI 1.11.1.1152
+:exec-args
should be replaced, not merged:org.babashka/cli {:exec true}
to arg map's metadata when invoking
functions with babashka.cli.exec
.:exec-fn
on command line:exec-args
with false
defaultclojure.basis
:error-fn
to handle errors (@jmglov):spec
options with additional "terse" options:require
to throw on missing options:validate
to throw on invalid optionsparse-opts
options in dispatch
table entries:args->opts
in parse-opts
to consume positional arguments as options:aliases
to :alias
(with backwards compatibility):closed
to :restrict
(with backwards compatibility):cmds-opts
to args->opts
(with backwards compatibility):closed
in parse-args
/ parse-opts
for throwing on unrecognized
options.babashka.cli.exec
for babashka:foo
and foo
as string to be coerced into :foo
keyword.cli/auto-coerce
should not coerce when input is not a stringcli/auto-coerce
:default
in :spec
format-opts
output.:spec
.format-opts
for help output + spec format:args
. See docs.:no-keyword-opts
to treat :foo
as option value rather than option namenil
to be a valid coerced value:coerce
option now supports a collection and type: [:keyword]
which
makes :collect
redundant and henceforth deprecated. The shorthand
:keywords
introduced in v0.2.16 is removed (breaking).:coerce
+ :collect
shorthands:ns-default
in deps alias:exec-fn
in deps alias:exec-args
on ns metadata:exec-args
in parse options to provide defaultsparse-opts
which replaces parse-args
and returns a single map.:org.babashka/cli
options in deps.edn
aliases.:exec-args
in aliasexec
--foo=bar
syntaxorg.babashka/cli
:collect
option for collecting values into collectiontrue
options without explicit boolean value and coercion:aliases
coerce
: ``:boolean,
:int,
:double,
:symbol,
:keyword`--foo
and -foo
as syntax sugar for :foo
Initial release
:input
and :coerce-fn
keys in its ex-data. See the "Error handling"
section in the README for details on the new exception format.:keywords
introduced in v0.2.16 is removed
(breaking).Can you improve this documentation? These fine people already did:
Michiel Borkent, Lee Read, Gert Goet, Josh Glover, Teodor Heggelund & Josh Glover [He/Him]Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close