]> git.apps.os.sepia.ceph.com Git - linux-firmware.git/commitdiff
copy-firmware: add usage help text
authorTimur Tabi <ttabi@nvidia.com>
Mon, 17 Mar 2025 18:32:15 +0000 (13:32 -0500)
committerTimur Tabi <ttabi@nvidia.com>
Mon, 17 Mar 2025 22:45:37 +0000 (17:45 -0500)
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 <ttabi@nvidia.com>
copy-firmware.sh

index dd4b9b6f9d6aa446a67b3baf36274c1dde9a4586..9a2b71568e0f682dc7ac792a8bf1a6ffbda5f25b 100755 (executable)
@@ -11,8 +11,13 @@ compext=
 destdir=
 num_jobs=1
 
+usage() {
+    echo "Usage: $0 [-v] [-jN] [--xz|--zstd] <destination directory>"
+}
+
 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: $*"