[pacman-dev] [PATCH 03/11] pacdiff: streamline usage function

Gordian Edenhofer gordian.edenhofer at gmail.com
Thu Sep 29 10:23:03 UTC 2016


Signed-off-by: Gordian Edenhofer <gordian.edenhofer at gmail.com>
---
 contrib/pacdiff.sh.in | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/contrib/pacdiff.sh.in b/contrib/pacdiff.sh.in
index dff2115..840e36f 100644
--- a/contrib/pacdiff.sh.in
+++ b/contrib/pacdiff.sh.in
@@ -32,31 +32,31 @@ declare -i USE_FIND=0 USE_LOCATE=0 USE_PACDB=0 OUTPUTONLY=0
 m4_include(../scripts/library/output_format.sh)
 
 usage() {
-	cat <<EOF
-${myname} (pacman) v${myver}
-
-A simple program to merge or remove pacnew/pacsave files.
-
-Usage: $myname [-l | -f | -p] [--nocolor]
-
-Search Options:     select one (default: --pacmandb)
-  -l/--locate       scan using locate
-  -f/--find         scan using find
-  -p/--pacmandb     scan active config files from pacman database
-
-General Options:
-  -o/--output       print files instead of merging them
-  --nocolor         remove colors from output
-
-Environment Variables:
-  DIFFPROG          override the merge program: (default: 'vim -d')
-  DIFFSEARCHPATH    override the search path. (only when using find)
-                    (default: /etc)
-
-Example: DIFFPROG=meld DIFFSEARCHPATH="/boot /etc /usr" $myname
-Example: $myname --output --locate
-
-EOF
+	printf "%s (pacman) %s\n" "$myname" "$myver"
+	echo
+	printf -- "$(gettext "A simple program to merge or remove pacnew/pacsave files")\n"
+	echo
+	printf -- "$(gettext "Usage: %s <operation> [options]")\n" "$0"
+	echo
+	printf -- "$(gettext "Search Options:")\n"
+	printf -- "$(gettext "  -l, --locate      Scan using locate")\n"
+	printf -- "$(gettext "  -f, --find        Scan using find")\n"
+	printf -- "$(gettext "  -p, --pacmandb    Scan active config files from pacman database")\n"
+	echo
+	printf -- "$(gettext "Options:")\n"
+	printf -- "$(gettext "  -o, --output      Print files instead of merging them")\n"
+	printf -- "$(gettext "  -m, --nocolor     Remove colors from output")\n"
+	echo
+	printf -- "$(gettext "Environment Variables:")\n"
+	printf -- "$(gettext "  DIFFPROG          Override the merge program: (default: 'vim -d')")\n"
+	printf -- "$(gettext "\
+  DIFFSEARCHPATH    Override the search path. (only when using find)\n\
+                    (default: /etc)")\n"
+	echo
+	printf -- "$(gettext "Examples:")"
+	printf -- "    DIFFPROG=meld DIFFSEARCHPATH=\"/boot /etc /usr\" %s\n" "$myname"
+	printf -- "    %s --output --locate\n" "$myname"
+	echo
 }
 
 version() {
-- 
2.10.0


More information about the pacman-dev mailing list