Add option to show recipe's description when running it - useful for CI
When running just recipes in CI, it might be good to print a description of each recipe before running it - by using some new optional flag, or maybe as part of the --verbose. This way anyone examining CI logs would have a better understanding of what each step is for, and possibly have some hints on how to fix it if it breaks
As a workaround, you can achieve it this way, but a built-in optional feature would definitely be nicer.
# Performs foo task.
foo:
@{{ if env("IS_CI", '') == '1' { \
quote(just_executable()) + ' -f ' + quote(justfile()) + " --list | \
grep -P '^ *foo ' | sed -Ee 's/^[^#]+# *//g'" \
} else { "" } \
}}
echo 'Running the recipe...'
This example prints recipe description only when running in CI that sets the example IS_CI environment variable to 1.
I think that would be useful. I think probably landing it as a new flag, maybe --explain, and then later think about whether or not it should be the default when --verbose is used.
Done in #2319!