diff options
author | Allan McRae <allan@archlinux.org> | 2011-06-13 14:36:41 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-15 16:19:45 +0200 |
commit | e27e658033d500c22b9dd4974fa3fbcc378f35b9 (patch) | |
tree | 156ddaa8cda4127db9fd3f0d0149244358462c9f | |
parent | 53f4e431918fdfd4e2433c387da1c89c697613bf (diff) | |
download | pacman-e27e658033d500c22b9dd4974fa3fbcc378f35b9.tar.gz pacman-e27e658033d500c22b9dd4974fa3fbcc378f35b9.tar.xz |
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>
-rw-r--r-- | scripts/library/parse_options.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/library/parse_options.sh b/scripts/library/parse_options.sh index 32aa0bee..8057c288 100644 --- a/scripts/library/parse_options.sh +++ b/scripts/library/parse_options.sh @@ -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 |