Clean up repo-add usage message
This now includes -s and -v, tailors itself to the current command,
and is formatted more like that of other pacman commands.
Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
---
I don't know why it was base64'd - I guess Gmail did that, since I sent that
one by pasting the content there? Thanks for the tip about where to put
commentary like this.
scripts/repo-add.sh.in | 43 +++++++++++++++++++++++++------------------
1 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index bd2d90b..568f628 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -63,32 +63,39 @@ error() {
# print usage instructions
usage() {
- printf "repo-add, repo-remove (pacman) %s
" "$myver"
- printf "$(gettext "Usage: repo-add [-d] [-f] [-q] [-s] [-v] <path-to-db> <package|delta> ...
")"
- printf "$(gettext "Usage: repo-remove [-q] <path-to-db> <packagename|delta> ...
")"
- printf "$(gettext "
+ cmd="$(basename $0)"
+ printf "%s (pacman) %s
" "$cmd" "$myver"
+ if [[ $cmd == "repo-add" ]] ; then
+ printf "$(gettext "Usage: repo-add [-d] [-f] [-q] [-s] [-v] <path-to-db> <package|delta> ...
")"
+ printf "$(gettext "
repo-add will update a package database by reading a package file.
Multiple packages to add can be specified on the command line.
")"
- printf "$(gettext "
+ printf "$(gettext "Options:
")"
+ printf "$(gettext " -d, --delta generate and add delta for package update
")"
+ printf "$(gettext " -f, --files update database's file list
")"
+ elif [[ $cmd == "repo-remove" ]] ; then
+ printf "$(gettext "Usage: repo-remove [-q] [-s] [-v] <path-to-db> <packagename|delta> ...
")"
+ printf "$(gettext "
repo-remove will update a package database by removing the package name
specified on the command line from the given repo database. Multiple
packages to remove can be specified on the command line.
")"
- printf "$(gettext "
-Use the -q/--quiet flag to minimize output to basic messages, warnings,
-and errors.
")"
- printf "$(gettext "
-Use the -d/--delta flag to automatically generate and add a delta file
-between the old entry and the new one, if the old package file is found
-next to the new one.
")"
- printf "$(gettext "
-Use the -f/--files flag to update a database including file entries.
-See repo-add(8) for more details and descriptions of the available options.
")"
- echo "$(gettext "Example: repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz")"
- echo "$(gettext "Example: repo-remove /path/to/repo.db.tar.gz kernel26")"
+ printf "$(gettext "Options:
")"
+ fi
+ printf "$(gettext " -q, --quiet minimize output
")"
+ printf "$(gettext " -s, --sign sign database with GnuPG after update
")"
+ printf "$(gettext " -v, --verify verify database's signature before update
")"
+ printf "$(gettext "
+See %s(8) for more details and descriptions of the available options.
")" $cmd
+ if [[ $cmd == "repo-add" ]] ; then
+ echo "$(gettext "Example: repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz")"
+ elif [[ $cmd == "repo-remove" ]] ; then
+ echo "$(gettext "Example: repo-remove /path/to/repo.db.tar.gz kernel26")"
+ fi
}
version() {
- printf "repo-add, repo-remove (pacman) %s
" "$myver"
+ cmd="$(basename $0)"
+ printf "%s (pacman) %s
" "$cmd" "$myver"
printf "$(gettext "
Copyright (C) 2006-2008 Aaron Griffin <aaron@archlinux.org>.
Copyright (c) 2007-2008 Dan McGee <dan@archlinux.org>.
--
1.7.4.1