Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Attributes

Recipes, mod statements, and aliases may be annotated with attributes that change their behavior.

NameTypeDescription
[arg(ARG, help="HELP")]1.46.0recipePrint help string HELP for ARG in usage messages. May be a const expression1.55.0.
[arg(ARG, long="LONG")]1.46.0recipeRequire 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.0recipeRequire values of argument ARG to match regular expression PATTERN. May be a const expression1.55.0.
[arg(ARG, short="S")]1.46.0recipeRequire 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.0recipeMakes option ARG a flag which does not take a value.
[cache]1.54.0recipeSkip recipe invocations when a matching entry exists in the cache. See cached recipes for details. Currently unstable.
[confirm(PROMPT)]1.23.0recipeRequire confirmation prior to executing recipe with a custom prompt.
[confirm]1.17.0recipeRequire confirmation prior to executing recipe.
[continue(SIGNALS)]1.54.0recipeContinue execution normally if a command is interrupted by any of SIGNALS and exits successfully. Defaults to SIGINT.
[default]1.43.0recipeUse recipe as module’s default recipe.
[doc(DOC)]1.27.0module, recipeSet recipe or module’s documentation comment to DOC.
[dragonfly]1.47.0recipeEnable recipe on DragonFly BSD.
[env(NAME, VALUE)] 1.47.0recipeSet environment variable NAME to VALUE for recipe. NAME and VALUE may be expressions1.51.0.
[extension(EXT)]1.32.0recipeSet shebang recipe script’s file extension to EXT. EXT should include a period if one is desired.
[exit-message]1.39.0recipePrint error message if recipe fails regardless of set no-exit-message.
[freebsd]1.47.0recipeEnable recipe on FreeBSD.
[group(NAME)]1.27.0module, recipePut recipe or module in group NAME.
[android]1.50.0recipeEnable recipe on Android.
[linux]1.8.0recipeEnable recipe on Linux.
[macos]1.8.0recipeEnable recipe on macOS.
[metadata(METADATA)]1.42.0recipeAttach METADATA to recipe.
[netbsd]1.47.0recipeEnable recipe on NetBSD.
[no-cd]1.9.0recipeDon’t change directory before executing recipe.
[no-exit-message]1.7.0recipeDon’t print an error message if recipe fails.
[no-quiet]1.23.0recipeOverride globally quiet recipes and always echo out the recipe.
[openbsd]1.38.0recipeEnable recipe on OpenBSD.
[parallel]1.42.0recipeRun this recipe’s dependencies in parallel.
[positional-arguments]1.29.0recipeTurn on positional arguments for this recipe.
[private]1.10.0alias, recipeMake recipe, alias, or variable private. See Private Recipes.
[script(COMMAND)]1.32.0recipeExecute recipe as a script interpreted by COMMAND. See script recipes for more details.
[script]1.33.0recipeExecute recipe as script. See script recipes for more details.
[shell]1.52.0recipeExecute recipe as a shell recipe, overriding set default-script.
[unix]1.8.0recipeEnable recipe on unixes. (Includes macOS).
[windows]1.8.0recipeEnable recipe on Windows.
[working-directory(PATH)]1.38.0recipeSet 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: