Skip to content

Commit 7e4eb32

Browse files
committed
Make help flag check more robust
1 parent 6e76b13 commit 7e4eb32

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ci/run_task.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@ main() {
5757
local single_crate="${2:-}"
5858
local crates_script="$REPO_DIR/contrib/crates.sh"
5959

60-
# FIXME: This is a hackish way to get the help flag.
61-
if [ "$task" = "usage" ] || [ "$task" = "-h" ] || [ "$task" = "--help" ]; then
62-
usage
63-
exit 0
64-
fi
60+
# Check for help flags in any position.
61+
for arg in "$@"; do
62+
case "$arg" in
63+
-h|--help|help|usage)
64+
usage
65+
exit 0
66+
;;
67+
esac
68+
done
6569

6670
check_required_commands
6771

0 commit comments

Comments
 (0)