:enumAI-generated design record. Read as AI prose.
STATUS: IMPLEMENTED (unreleased). Raised by lread during the bb tasks CLI review (2026-07).
:enumwas proposed by borkdude in the same thread.
Fixed choices are available when rendering help. Completion and validation
errors displayed them, but --help did not:
$ bb deploy --environment qa
Error: Invalid value for option --environment: qa. Expected one of: dev, prod, staging
Show set-valued :validate values in --help. Use the sorted order already
used by completion and validation errors.
Add :enum for ordered allowed values. Sets require sorting, which displays
#{"dev" "staging" "prod"} as dev, prod, staging. :enum preserves the
declared order.
Arguments:
<environment> Target environment (one of: dev, staging, prod)
Keyword values render without the leading colon. Use :coerce :keyword to match
keyword values. :enum does not infer coercion.
Render :args->opts entries under Arguments: in help. Their values are
consumed positionally.
Surveyed argparse, click, clap, cobra/pflag, kingpin, commander, yargs, picocli, tools.cli, malli.
choices is common in argparse, click, commander, yargs and kingpin.
enum is used by clap, picocli and malli. :enum matches malli.[possible values: ...], commander (choices: ...), yargs
[choices: ...]). Our (one of: ...) matches that shape and reuses the
phrase from our own error (Expected one of: ...), so help and error agree.
argparse/click instead put choices in the usage/metavar line.Reject :choices because :enum matches malli and is shorter. Keep coercion
explicit instead of inferring it from :enum element types.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |