mirror of
https://git.proxmox.com/git/mirror_linux-firmware
synced 2025-07-25 22:56:56 +00:00
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 <ttabi@nvidia.com>
This commit is contained in:
parent
6a94efbe2a
commit
07ffc2005a
@ -11,8 +11,13 @@ compext=
|
|||||||
destdir=
|
destdir=
|
||||||
num_jobs=1
|
num_jobs=1
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [-v] [-jN] [--xz|--zstd] <destination directory>"
|
||||||
|
}
|
||||||
|
|
||||||
err() {
|
err() {
|
||||||
printf "ERROR: %s\n" "$*"
|
printf "ERROR: %s\n" "$*"
|
||||||
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,6 +71,11 @@ while test $# -gt 0; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-h|--help)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if test -n "$destdir"; then
|
if test -n "$destdir"; then
|
||||||
err "unknown command-line options: $*"
|
err "unknown command-line options: $*"
|
||||||
|
Loading…
Reference in New Issue
Block a user