@@ -30,7 +30,7 @@ usage() {
3030 cat << EOF
3131Usage:
3232
33- ./run_task.sh TASK
33+ ./run_task.sh TASK [CRATE1] [CRATE2] ...
3434
3535TASK
3636 - stable Run tests with stable toolchain.
4141 - docsrs Build docs with nightly toolchain.
4242 - bench Run the bench tests.
4343
44+ CRATES (optional)
45+ - If provided, run the task only on the specified crate(s).
46+ - Multiple crates can be specified as space-delimited arguments.
47+ - If not provided, run the task on all crates from contrib/crates.sh.
48+
4449Environment Variables:
4550 MAINTAINER_TOOLS_LOG_LEVEL Control script and cargo output verbosity.
4651 verbose (default) Show all script and cargo messages.
@@ -70,9 +75,16 @@ main() {
7075 fi
7176
7277 verbose_say " Repository: $REPO_DIR "
73- verbose_say " Script invocation: $0 $task "
78+ verbose_say " Script invocation: $0 $* "
79+
80+ # Shift to remove the task argument, leaving only crate arguments.
81+ shift
7482
75- if [ -e " $crates_script " ]; then
83+ # Override crates.sh if there are crate args.
84+ if [ " $# " -gt 0 ]; then
85+ CRATES=" $* "
86+ verbose_say " Using specified crate(s): $CRATES "
87+ elif [ -e " $crates_script " ]; then
7688 verbose_say " Sourcing $crates_script "
7789 # can't find the file because of the ENV var
7890 # shellcheck source=/dev/null
0 commit comments