From 6bb1c32f13218ead048180860550bc5a9e394491 Mon Sep 17 00:00:00 2001 From: Arne Brasseur Date: Sat, 17 Feb 2024 13:39:10 +0100 Subject: [PATCH] # 0.4.24 (2024-02-17 / 5a1e316) ## Added - Bind the options map to `cli/*opts*`, for easy access. - Show the default for a flag in the help text. - Add a docstring to the main entry point (`dispatch`) - Bind `*opts*` during flag handler execution ## Fixed - Recognize `-` and `\\--foo` as positional args ## Changed - When given both a `:default` and a `:handler` for a flag, call the handler with the default, rather than just assoc-ing it. - When given a string `: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. - Improve and document the processing logic, especially when it comes to subcommand flags with handler functions. --- .VERSION_PREFIX | 2 +- CHANGELOG.md | 4 ++-- README.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.VERSION_PREFIX b/.VERSION_PREFIX index 1d71ef9..e6adf3f 100644 --- a/.VERSION_PREFIX +++ b/.VERSION_PREFIX @@ -1 +1 @@ -0.3 \ No newline at end of file +0.4 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d830ab8..e330b8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Unreleased +# 0.4.24 (2024-02-17 / 5a1e316) ## Added @@ -52,4 +52,4 @@ approaching the envisioned scope for this library. - subcommand handling - rudimentary flag handling -- help text generation +- help text generation \ No newline at end of file diff --git a/README.md b/README.md index 56e1bbe..a78d20e 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Command line parser with good subcommand and help handling To use the latest release, add the following to your `deps.edn` ([Clojure CLI](https://clojure.org/guides/deps_and_cli)) ``` -com.lambdaisland/cli {:mvn/version "0.3.19-alpha"} +com.lambdaisland/cli {:mvn/version "0.4.24"} ``` or add the following to your `project.clj` ([Leiningen](https://leiningen.org/)) ``` -[com.lambdaisland/cli "0.3.19-alpha"] +[com.lambdaisland/cli "0.4.24"] ```