-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
(comming from using usage in mise tasks)
It would be nice to define possible choices values similar to the complete specification complete "foo" run="my_command".
Currently, I have the option to manually define all possible values in choices and have them show up in the help/docs. Or have my autocomplete options generated by an external command, but not show the options in any docs.
But sometimes my possible choices are options belonging to an external tool (e.g., services in a compose config) and I don't want to manually write them into my spec.
Example:
Manually defined choices
#!/usr/bin/env bash
# .mise/tasks/build
#MISE description="Build the docker images."
#
#USAGE arg "<services>..." help="The services to build." default="app database" {
#USAGE choices "app" "database"
#USAGE }
# …mise run build --help
# =>
# Usage: build [services]...
# Arguments:
# [services]...
# The services to build.
# [possible values: app, database]mise run build <tab><tab>
# =>
# app databaseNo choices, but with autocomplete
#!/usr/bin/env bash
# .mise/tasks/build
#MISE description="Build the docker images."
#
#USAGE arg "<services>..." help="The services to build."
#USAGE complete "services" run="docker compose config | yq '.services | keys[]'"
# …mise run build --help
# =>
# Usage: build [services]...
# Arguments:
# [services]...
# The services to build.mise run build <tab><tab>
# =>
# app databaseMetadata
Metadata
Assignees
Labels
No labels