For breaking changes, check here.
Babashka CLI: turn Clojure functions into CLIs!
- #141: docs: briefly cover adding production polish to a cli (@lread)
- #144: deployed pom now reflects min supported clojure version & doc supported platforms/versions (@lread)
- #126:
-value accidentally parsed as option, e.g.--file - - #124: Specifying exec fn that starts with hyphen is treated as option
- Drop Clojure 1.9 support. Minimum Clojure version is now 1.10.3.
- #122: introduce new
:repeated-optsoption to enforce repeating the option for accepting multiple values (e.g.--foo 1 --foo 2rather than--foo 1 2)
- Remove
pom.xmlandproject.cljfor cljdoc
- #116: Un-deprecate
:collectoption to support custom transformation of arguments to collections (@lread) - Support
:collectin:spec
- Fix #109: allow options to start with a number
- Fix #102:
format-tablecorrectly pads cells containing ANSI escape codes - Fix #106: Multiple options before subcommand conflict with subcommand
- Fix #104: Allow extra arguments to be passed before options in exec function
- Fix #98: internal options should not interfere with :restrict
- Fix #96: prevent false defaults from being removed/ignored
- Fix #91: keyword options and hyphen options should not mix
Fix #89: long option never represents alias
Fix #82: prefer alias over composite option
- Add
:optsto:error-fninput - Fix command line args for test runner
--dirs,--only, etc
- Fix
--no-option(--noprefix) in combination with subcommands
- Prioritize
:exec-argsover spec:defaults dispatchimprovements (@Sohalt, @borkdude):- The
:cmdsorder of entries in the table doesn't matter - Support parsing intermediate options:
foo --opt1=never bar --opt2=always
- The
- #68: alternative to shutdown-agents similar to clojure CLI's
-Xand-Tbehavior
- #64: Support combined short options:
-abc=>{:a true :b true :c true} - #17: Support
--no-prefix for negative flags:--no-colors=>{:colors false}
- Improve
auto-coerce: coerce"nil"tonil(@teodorlu)
- Improve
auto-coercefor keywords (@teodorlu)
- Make
babashka.execcompatible with clojure CLI1.11.1.1152+
- #58: implicit true should not be transformed to string value
- Preserve exception cause in coercion for better error messages
- #56:
:exec-argsshould be replaced, not merged
- #55: Last keyword option not parsed when previous value is implicit boolean
- Add
:org.babashka/cli {:exec true}to arg map's metadata when invoking functions withbabashka.cli.exec.
- #48: allow overriding
:exec-fnon command line
- #46: fix trailing boolean option coercion
- #39: handle
:exec-argswithfalsedefault
- Be tolerant of tags in
clojure.basis
- Added
:error-fnto handle errors (@jmglov) - Merge
:specoptions with additional "terse" options
- Added
:requireto throw on missing options - Added
:validateto throw on invalid options - Support
parse-optsoptions indispatchtable entries - Add
:args->optsinparse-optsto consume positional arguments as options - Renamed
:aliasesto:alias(with backwards compatibility) - Renamed
:closedto:restrict(with backwards compatibility) - Renamed
:cmds-optstoargs->opts(with backwards compatibility)
- Support
:closedinparse-args/parse-optsfor throwing on unrecognized options. - Fix default-width calculation in format-opts
- Improve
babashka.cli.execfor babashka - Improve auto-parsing
- Improve auto-coercion and keyword arguments
- Accept both
:fooandfooas string to be coerced into:fookeyword.
cli/auto-coerceshould not coerce when input is not a string
- Compatibility with Clojure 1.9 and older versions of ClojureScript
- #10: Auto-coerce values using
cli/auto-coerce
- Clean up unnecessary dependency
- #22: respect
:defaultin:spec
- #20: Preserve namespace in
format-optsoutput. - Fix coercion with
:spec.
format-optsfor help output + spec format
- Support parsing of trailing
:args. See docs.
:no-keyword-optsto treat:fooas option value rather than option name
- Allow
nilto be a valid coerced value
- The
:coerceoption now supports a collection and type:[:keyword]which makes:collectredundant and henceforth deprecated. The shorthand:keywordsintroduced in v0.2.16 is removed (breaking).
- Support
:coerce+:collectshorthands
- Support
:ns-defaultin deps alias
- Support
:exec-fnin deps alias
- Support
:exec-argson ns metadata
- Support
:exec-argsin parse options to provide defaults
- Add support for subcommands
- Introduce
parse-optswhich replacesparse-argsand returns a single map.
- Support
:org.babashka/clioptions indeps.ednaliases.
- Support
:exec-argsin alias
- Separate namespace and invoked function in
exec
- Support
--foo=barsyntax
- Move metadata to
org.babashka/cli
- Allow implicit boolean options to be collected
- Support
:collectoption for collecting values into collection - Support boolean
trueoptions without explicit boolean value and coercion
- Support
:aliases - Support keywords in
coerce: ``:boolean,:int`, `:double`, `:symbol`, `:keyword` - Support
--fooand-fooas syntax sugar for:foo
Initial release
- Unreleased: The exception thrown on coercion failures no longer contains the
:inputand:coerce-fnkeys in its ex-data. See the "Error handling" section in the README for details on the new exception format. - v0.2.17: The shorthand
:keywordsintroduced in v0.2.16 is removed (breaking).