From: Timur Tabi Date: Mon, 17 Mar 2025 18:32:15 +0000 (-0500) Subject: copy-firmware: add usage help text X-Git-Tag: 20250410~18^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07ffc2005a975030408cc836b19087e46fc24729;p=thirdparty%2Flinux-firmware.git copy-firmware: add usage help text Add a -h/--help command-line option to show some usage help text. Also display that usage whenever an error occurs. Signed-off-by: Timur Tabi --- diff --git a/copy-firmware.sh b/copy-firmware.sh index dd4b9b6f..9a2b7156 100755 --- a/copy-firmware.sh +++ b/copy-firmware.sh @@ -11,8 +11,13 @@ compext= destdir= num_jobs=1 +usage() { + echo "Usage: $0 [-v] [-jN] [--xz|--zstd] " +} + err() { printf "ERROR: %s\n" "$*" + usage exit 1 } @@ -66,6 +71,11 @@ while test $# -gt 0; do shift ;; + -h|--help) + usage + exit 1 + ;; + *) if test -n "$destdir"; then err "unknown command-line options: $*"