Skip to content

Commit

Permalink
# 0.4.24 (2024-02-17 / 5a1e316)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
plexus committed Feb 17, 2024
1 parent 5a1e316 commit 6bb1c32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .VERSION_PREFIX
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3
0.4
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Unreleased
# 0.4.24 (2024-02-17 / 5a1e316)

## Added

Expand Down Expand Up @@ -52,4 +52,4 @@ approaching the envisioned scope for this library.

- subcommand handling
- rudimentary flag handling
- help text generation
- help text generation
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
```
<!-- /installation -->

Expand Down

0 comments on commit 6bb1c32

Please sign in to comment.