Skip to content

Commit

Permalink
Print alloc-limits-from-test-output usage when no args (#3041)
Browse files Browse the repository at this point in the history
Motivation:

The alloc-limits-from-test-output doesn't print usage if you don't pass
in a format arg, it just sits and waits for stdin.

Modifications:

Print usage if running interactively

Result:

Easier to get usage
  • Loading branch information
glbrntt authored Jan 7, 2025
1 parent 56f9b7c commit 100b1f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev/alloc-limits-from-test-output
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ case "$mode_flag" in
;;
esac

# stdin is coming from a terminal, i.e. nothing is being piped in.
if [[ -t 0 ]]; then
usage
exit 1
fi

function allow_slack() {
raw="$1"
if [[ ! "$raw" =~ ^[0-9]+$ ]]; then
Expand Down

0 comments on commit 100b1f4

Please sign in to comment.