FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-15-2011, 09:13 AM
Allan McRae
 
Default 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>
---
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 32aa0be..8057c28 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
--
1.7.5.4
 

Thread Tools




All times are GMT. The time now is 07:25 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org