From 100b1f4ff9c0d21c43bd9f5beafda8e7693a12f7 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Tue, 7 Jan 2025 10:36:03 +0000 Subject: [PATCH] Print alloc-limits-from-test-output usage when no args (#3041) 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 --- dev/alloc-limits-from-test-output | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev/alloc-limits-from-test-output b/dev/alloc-limits-from-test-output index 2fa9322ce..d6718709d 100755 --- a/dev/alloc-limits-from-test-output +++ b/dev/alloc-limits-from-test-output @@ -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