properly error on options missing an optarg
This commit is contained in:
parent
808f744802
commit
120d233639
@ -70,6 +70,9 @@ while getopts ':Lpr:U' flag; do
|
||||
# trim trailing slashes
|
||||
root=${OPTARG%%+(/)}
|
||||
;;
|
||||
:)
|
||||
die '%s: option requires an argument -- '\''%s'\' "${0##*/}" "$OPTARG"
|
||||
;;
|
||||
?)
|
||||
die '%s: invalid option -- '\''%s'\' "${0##*/}" "$OPTARG"
|
||||
;;
|
||||
|
@ -38,6 +38,9 @@ while getopts ':dr:' flag; do
|
||||
r)
|
||||
newroot=$OPTARG
|
||||
;;
|
||||
:)
|
||||
die '%s: option requires an argument -- '\''%s'\' "${0##*/}" "$OPTARG"
|
||||
;;
|
||||
?)
|
||||
die '%s: invalid option -- '\''%s'\' "${0##*/}" "$OPTARG"
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user