mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 07:48:50 -05:00
parse_options: adjust error messages
Provide consistent error messages for unknown long and short options. Also get full string translation for the messages. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
53f4e43191
commit
e27e658033
@ -25,7 +25,7 @@ parse_options() {
|
||||
shift
|
||||
printf " '%s'" "$1"
|
||||
else
|
||||
echo "@SCRIPTNAME@: option '$1' $(gettext "requires an argument")" >&2
|
||||
printf "@SCRIPTNAME@: $(gettext "option %s requires an argument")" "'$1'" >&2
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
@ -50,7 +50,7 @@ parse_options() {
|
||||
shift
|
||||
printf " '%s'" "${1}"
|
||||
else
|
||||
echo "@SCRIPTNAME@: option $(gettext "requires an argument") -- '${1:i:1}'" >&2
|
||||
printf "@SCRIPTNAME@: $(gettext "option %s requires an argument")" "'-${1:i:1}'" >&2
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
@ -59,7 +59,7 @@ parse_options() {
|
||||
printf ' -%s' "${1:i:1}"
|
||||
fi
|
||||
else
|
||||
echo "@SCRIPTNAME@: $(gettext "invalid option") -- '${1:i:1}'" >&2
|
||||
echo "@SCRIPTNAME@: $(gettext "unrecognized option") '-${1:i:1}'" >&2
|
||||
ret=1
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user