diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2019-02-06 02:40:07 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-02-06 03:35:56 +0000 |
commit | c80032179ca00694a70ff71aa5cd0db14a8a45e2 (patch) | |
tree | 6b15e34d730d7776dc3c7164c48ca3ba6287d87c | |
parent | ccf07ee2f187ad3e7a538d468469772bf536ef99 (diff) |
Make all commands return 2 in case of a usage error
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rwxr-xr-x | lsinitramfs | 4 | ||||
-rwxr-xr-x | mkinitramfs | 6 | ||||
-rwxr-xr-x | unmkinitramfs | 2 | ||||
-rwxr-xr-x | update-initramfs | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lsinitramfs b/lsinitramfs index 1235e4d..f86ad9c 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -9,7 +9,7 @@ usage() if [ "$#" -eq 0 ] ; then usage >&2 - exit 1 + exit 2 fi umi_opts="--list" @@ -17,7 +17,7 @@ umi_opts="--list" OPTIONS=$(getopt -o hl --long help,long -n "$0" -- "$@") # Check for non-GNU getopt # shellcheck disable=SC2181 -if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 1 ; fi +if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 2 ; fi eval set -- "$OPTIONS" diff --git a/mkinitramfs b/mkinitramfs index aaed605..3c3eb6c 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -26,14 +26,14 @@ Options: See mkinitramfs(8) for further details. EOF - exit 1 + exit 2 } OPTIONS=$(getopt -o c:d:ko:r:v -n "$0" -- "$@") # Check for non-GNU getopt # shellcheck disable=SC2181 -if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 1 ; fi +if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 2 ; fi eval set -- "$OPTIONS" @@ -154,7 +154,7 @@ esac case "${version}" in */*) echo "$PROG: ${version} is not a valid kernel version" >&2 - exit 1 + exit 2 ;; esac diff --git a/unmkinitramfs b/unmkinitramfs index 9414403..852bc1b 100755 --- a/unmkinitramfs +++ b/unmkinitramfs @@ -120,7 +120,7 @@ splitinitramfs() OPTIONS=$(getopt -o hv --long help,list,verbose -n "$0" -- "$@") # Check for non-GNU getopt # shellcheck disable=SC2181 -if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 1 ; fi +if [ $? != 0 ] ; then echo "W: non-GNU getopt" >&2 ; exit 2 ; fi cpio_opts="--preserve-modification-time --no-absolute-filenames --quiet" expected_args=2 diff --git a/update-initramfs b/update-initramfs index c059266..2a8a413 100755 --- a/update-initramfs +++ b/update-initramfs @@ -56,7 +56,7 @@ usage_error() printf "%s\\n\\n" "${*}" >&2 fi usage >&2 - exit 1 + exit 2 } mild_panic() |