Attributes
Recipes, mod statements, and aliases may be annotated with attributes that
change their behavior.
| Name | Type | Description |
|---|---|---|
[arg(ARG, help="HELP")]1.46.0 | recipe | Print help string HELP for ARG in usage messages. May be a const expression1.55.0. |
[arg(ARG, long="LONG")]1.46.0 | recipe | Require values of argument ARG to be passed as --LONG option. If the parameter is variadic, the option is repeatable<sup1.55.0master. |
[arg(ARG, pattern="PATTERN")]1.45.0 | recipe | Require values of argument ARG to match regular expression PATTERN. May be a const expression1.55.0. |
[arg(ARG, short="S")]1.46.0 | recipe | Require values of argument ARG to be passed as short -S option. If the parameter is variadic, the option is repeatable1.55.0. |
[arg(ARG, value=VALUE)]1.46.0 | recipe | Makes option ARG a flag which does not take a value. |
[cache]1.54.0 | recipe | Skip recipe invocations when a matching entry exists in the cache. See cached recipes for details. Currently unstable. |
[confirm(PROMPT)]1.23.0 | recipe | Require confirmation prior to executing recipe with a custom prompt. |
[confirm]1.17.0 | recipe | Require confirmation prior to executing recipe. |
[continue(SIGNALS)]1.54.0 | recipe | Continue execution normally if a command is interrupted by any of SIGNALS and exits successfully. Defaults to SIGINT. |
[default]1.43.0 | recipe | Use recipe as module’s default recipe. |
[doc(DOC)]1.27.0 | module, recipe | Set recipe or module’s documentation comment to DOC. |
[dragonfly]1.47.0 | recipe | Enable recipe on DragonFly BSD. |
[env(NAME, VALUE)] 1.47.0 | recipe | Set environment variable NAME to VALUE for recipe. NAME and VALUE may be expressions1.51.0. |
[extension(EXT)]1.32.0 | recipe | Set shebang recipe script’s file extension to EXT. EXT should include a period if one is desired. |
[exit-message]1.39.0 | recipe | Print error message if recipe fails regardless of set no-exit-message. |
[freebsd]1.47.0 | recipe | Enable recipe on FreeBSD. |
[group(NAME)]1.27.0 | module, recipe | Put recipe or module in group NAME. |
[android]1.50.0 | recipe | Enable recipe on Android. |
[linux]1.8.0 | recipe | Enable recipe on Linux. |
[macos]1.8.0 | recipe | Enable recipe on macOS. |
[metadata(METADATA)]1.42.0 | recipe | Attach METADATA to recipe. |
[netbsd]1.47.0 | recipe | Enable recipe on NetBSD. |
[no-cd]1.9.0 | recipe | Don’t change directory before executing recipe. |
[no-exit-message]1.7.0 | recipe | Don’t print an error message if recipe fails. |
[no-quiet]1.23.0 | recipe | Override globally quiet recipes and always echo out the recipe. |
[openbsd]1.38.0 | recipe | Enable recipe on OpenBSD. |
[parallel]1.42.0 | recipe | Run this recipe’s dependencies in parallel. |
[positional-arguments]1.29.0 | recipe | Turn on positional arguments for this recipe. |
[private]1.10.0 | alias, recipe | Make recipe, alias, or variable private. See Private Recipes. |
[script(COMMAND)]1.32.0 | recipe | Execute recipe as a script interpreted by COMMAND. See script recipes for more details. |
[script]1.33.0 | recipe | Execute recipe as script. See script recipes for more details. |
[shell]1.52.0 | recipe | Execute recipe as a shell recipe, overriding set default-script. |
[unix]1.8.0 | recipe | Enable recipe on unixes. (Includes macOS). |
[windows]1.8.0 | recipe | Enable recipe on Windows. |
[working-directory(PATH)]1.38.0 | recipe | Set recipe working directory. PATH may be an expression1.51.0 whose value is relative or absolute. If relative, it is interpreted relative to the default working directory. |
A recipe can have multiple attributes, either on multiple lines:
[no-cd]
[private]
foo:
echo "foo"
Or separated by commas on a single line1.14.0:
[no-cd, private]
foo:
echo "foo"
Attributes with a single argument may be written with a colon:
[group: 'bar']
foo: