SHA256
send usage to stderr on error paths
This commit is contained in:
@@ -221,7 +221,7 @@ while (( $# > 0 )); do
|
|||||||
-c|--config)
|
-c|--config)
|
||||||
cfgfile=$1
|
cfgfile=$1
|
||||||
shift
|
shift
|
||||||
[ -z "$cfgfile" ] && usage && exit 255
|
[ -z "$cfgfile" ] && echo "Error: missing argument for $opt" >&2 && usage >&2 && exit 255
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
usage
|
usage
|
||||||
@@ -232,8 +232,8 @@ while (( $# > 0 )); do
|
|||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
echo "Error: invalid option: $opt" >&2
|
echo "Error: invalid option: $opt" >&2
|
||||||
echo
|
echo >&2
|
||||||
usage
|
usage >&2
|
||||||
exit 255
|
exit 255
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -247,14 +247,14 @@ while (( $# > 0 )); do
|
|||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
echo "Error: invalid option: $opt" >&2
|
echo "Error: invalid option: $opt" >&2
|
||||||
echo
|
echo >&2
|
||||||
usage
|
usage >&2
|
||||||
exit 255
|
exit 255
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Error: invalid argument: $opt" >&2
|
echo "Error: invalid argument: $opt" >&2
|
||||||
echo
|
echo >&2
|
||||||
usage
|
usage >&2
|
||||||
exit 255
|
exit 255
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user