summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel M. Capella <polyzen@archlinux.org>2022-07-10 02:04:14 -0400
committerDaniel M. Capella <polyzen@archlinux.org>2022-09-07 01:42:57 -0400
commit88cbc84e4ec761931cc3e9cb9995845d39bc8d52 (patch)
treed584e0cd902357e1635b7727f6c664e01e44d632
parent6614285be9846158a67eb410c21f4f1100773b08 (diff)
Consistency fixes
Fixes #16 Signed-off-by: Daniel M. Capella <polyzen@archlinux.org>
-rw-r--r--completions/zsh/_checkupdates4
-rw-r--r--completions/zsh/_paccache8
-rw-r--r--completions/zsh/_pacdiff8
-rw-r--r--completions/zsh/_paclist4
-rw-r--r--completions/zsh/_paclog-pkglist4
-rw-r--r--completions/zsh/_pacscripts4
-rw-r--r--completions/zsh/_pacsearch6
-rw-r--r--completions/zsh/_pacsort4
-rw-r--r--completions/zsh/_pactree10
-rw-r--r--completions/zsh/_rankmirrors5
-rw-r--r--completions/zsh/_updpkgsums2
-rw-r--r--doc/checkupdates.8.adoc26
-rw-r--r--doc/paccache.8.adoc38
-rw-r--r--doc/pacdiff.8.adoc63
-rw-r--r--doc/pacsort.8.adoc15
-rw-r--r--doc/pactree.8.adoc56
-rw-r--r--doc/updpkgsums.8.adoc9
-rw-r--r--src/checkupdates.sh.in39
-rw-r--r--src/paccache.sh.in92
-rw-r--r--src/pacdiff.sh.in53
-rw-r--r--src/paclist.sh.in20
-rw-r--r--src/paclog-pkglist.sh.in24
-rw-r--r--src/pacscripts.sh.in28
-rw-r--r--src/pacsearch.pl.in4
-rw-r--r--src/pacsort.c35
-rw-r--r--src/pactree.c87
-rw-r--r--src/rankmirrors.sh.in91
-rw-r--r--src/updpkgsums.sh.in29
28 files changed, 418 insertions, 350 deletions
diff --git a/completions/zsh/_checkupdates b/completions/zsh/_checkupdates
index ac6fc27..047816c 100644
--- a/completions/zsh/_checkupdates
+++ b/completions/zsh/_checkupdates
@@ -3,8 +3,10 @@
declare -a args
args=(
'(--download -d)'{--download,-d}'[download pending updates to the pacman cache]'
- '(-)'{--help,-h}'[display help message and exit]'
+ '--nocolor[do not colorize output]'
'(--nosync -n)'{--nosync,-n}'[do not sync the temporary database]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
)
_arguments $args
diff --git a/completions/zsh/_paccache b/completions/zsh/_paccache
index 243149a..a02f34a 100644
--- a/completions/zsh/_paccache
+++ b/completions/zsh/_paccache
@@ -13,19 +13,19 @@ args=(
{--remove,-r}'[remove candidate packages]'
+ options
- '--min-atime[keep packages with an atime that is not older]:time: '
- '--min-mtime[keep packages with an mtime that is not older]:time: '
- '--nocolor[remove color from output]'
'(--arch -a)'{--arch=,-a+}'[scan for "arch" (default: all architectures)]:architecture: '
'(--cachedir -c)'{--cachedir=,-c+}'[scan "dir" for packages. can be used more than once]:directory:_files -/'
'(--force -f)'{--force,-f}'[apply force to mv(1) and rm(1) operations]'
'(--ignore -i)'{--ignore=,-i+}'[ignore "pkgs", comma-separated, alternatively - for stdin]:pkgs: '
'(--keep -k)'{--keep=,-k+}'[keep "num" of each package in the cache (default: 3)]:number: '
+ '--min-atime[keep packages with an atime that is not older]:time: '
+ '--min-mtime[keep packages with an mtime that is not older]:time: '
+ '--nocolor[do not colorize output]'
'(--null -z)'{--null,-z}'[use null delimiters for candidate names (only with -v and -vv)]'
'(--quiet -q)'{--quiet,-q}'[[minimize output]'
'(--uninstalled -u)'{--uninstalled,-u}'[target uninstalled packages]'
'(-)'{--help,-h}'[display help message and exit]'
- '(-)'{--version,-V}'[display version]'
+ '(-)'{--version,-V}'[display version information and exit]'
'*'{--verbose,-v}'[increase verbosity. specify up to 3 times]'
'*:targets: '
diff --git a/completions/zsh/_pacdiff b/completions/zsh/_pacdiff
index 2350731..5ceb36a 100644
--- a/completions/zsh/_pacdiff
+++ b/completions/zsh/_pacdiff
@@ -9,14 +9,14 @@ args=(
{-p,--pacmandb}'[scan active config files from pacman database]'
+ options
+ '(-b --backup)'{-b,--backup}'[when overwriting, save old files with .bak]'
'(-c --cachedir)'{-c,--cachedir}'[scan directory for 3-way merge base candidates]:directory:_files -/'
- '--nocolor[remove colors from output]'
+ '--nocolor[do not colorize output]'
'(-o --output)'{-o,--output}'[print files instead of merging them]'
'(-s --sudo)'{-s,--sudo}'[use sudo and sudoedit to merge/remove files]'
- '(-b --backup)'{-b,--backup}'[when overwriting, save old files with .bak]'
'(-3 --threeway)'{-3,--threeway}'[view diffs in 3-way fashion]'
- '(-)'{--help,-h}'[display help message]'
- '(-)--version[display version]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
)
_arguments $args
diff --git a/completions/zsh/_paclist b/completions/zsh/_paclist
index 4e24b4d..a2f06c7 100644
--- a/completions/zsh/_paclist
+++ b/completions/zsh/_paclist
@@ -2,8 +2,8 @@
declare -a args
args=(
- '(-)'{--help,-h}'[show help message]'
- '(-)'{--version,-V}'[show version]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
'*:repository:{_values repository $(pacman-conf --repo-list)}'
)
diff --git a/completions/zsh/_paclog-pkglist b/completions/zsh/_paclog-pkglist
index e97f8ae..aa940e0 100644
--- a/completions/zsh/_paclog-pkglist
+++ b/completions/zsh/_paclog-pkglist
@@ -2,8 +2,8 @@
declare -a args
args=(
- '(-)'{--help,-h}'[show help message]'
- '(-)'{--version,-V}'[show version]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
'::pacman log file:_files'
)
diff --git a/completions/zsh/_pacscripts b/completions/zsh/_pacscripts
index 820c08c..9158310 100644
--- a/completions/zsh/_pacscripts
+++ b/completions/zsh/_pacscripts
@@ -6,8 +6,8 @@ _pacscripts_packages() {
declare -a args
args=(
- '(-)'{--help,-h}'[print help message]'
- '(-)'{--version,-v}'[print program name and version]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
':package:{_alternative "packages:package:_pacscripts_packages" "files:pkgfile:_files"}'
)
diff --git a/completions/zsh/_pacsearch b/completions/zsh/_pacsearch
index 0e3d95d..d773716 100644
--- a/completions/zsh/_pacsearch
+++ b/completions/zsh/_pacsearch
@@ -2,9 +2,9 @@
declare -a args
args=(
- '(--nocolor -n)'{--nocolor,-n}'[turn off coloring]'
- '(-)'{--help,-h}'[display help message]'
- '(-)'{--version,-V}'[display version]'
+ '(--nocolor -n)'{--nocolor,-n}'[do not colorize output]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
':pattern: '
)
diff --git a/completions/zsh/_pacsort b/completions/zsh/_pacsort
index aaaed9c..d8923e6 100644
--- a/completions/zsh/_pacsort
+++ b/completions/zsh/_pacsort
@@ -7,8 +7,8 @@ args=(
'(--null -z)'{--null,-z}'[lines end with null bytes, not newlines]'
'(--reverse -r)'{--reverse,-r}'[sort in reverse order (default: oldest to newest)]'
'(--separator -t)'{--separator,-t}'[specify field separator (default: space)]:field separator: '
- '(-)'{--help,-h}'[display help message]'
- '(-)'{--version,-v}'[display the version]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
'*:files:_files'
)
diff --git a/completions/zsh/_pactree b/completions/zsh/_pactree
index fe71132..8496cf5 100644
--- a/completions/zsh/_pactree
+++ b/completions/zsh/_pactree
@@ -2,21 +2,21 @@
declare -a args
args=(
- '--config[set an alternate configuration file]:file:_files'
- '--debug[display debug messages]'
- '--gpgdir[set an alternate home directory for GnuPG]:directory:_files -/'
'(--ascii -a)'{--ascii,-a}'[use ASCII characters for tree formatting]'
'(--color -c)'{--color,-c}'[colorize output]'
+ '--config[set an alternate configuration file]:file:_files'
'(--dbpath -b)'{--dbpath,-b}'[set an alternate database location]'
+ '--debug[display debug messages]'
'(--depth -d)'{--depth,-d}'[limit the depth of recursion]:depth (number): '
+ '--gpgdir[set an alternate home directory for GnuPG]:directory:_files -/'
'(--graph -g)'{--graph,-g}'[generate output for graphviz'\''s dot]'
'(--linear -l)'{--linear,-l}'[enable linear output]'
'(--optional -o)'{--optional=-,-o-}'[controls at which depth to stop printing optional deps]::depth: '
'(--reverse -r)'{--reverse,-r}'[list packages that depend on the named package]'
'(--sync -s)'{--sync,-s}'[search sync databases instead of local]'
'(--unique -u)'{--unique,-u}'[show dependencies with no duplicates (implies -l)]'
- '(-)'{--help,-h}'[display help message]'
- '(-)'{--version,-v}'[display the version]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version,-V}'[display version information and exit]'
'*:package:{_values "package" $(pacman -Qq)}'
)
diff --git a/completions/zsh/_rankmirrors b/completions/zsh/_rankmirrors
index 2892d89..349b761 100644
--- a/completions/zsh/_rankmirrors
+++ b/completions/zsh/_rankmirrors
@@ -4,12 +4,13 @@ declare -a args
args=(
'-n[number of servers to output, 0 for all]:number of servers: '
'(--max-time -m)'{--max-time,-m}'[specify a ranking operation timeout, can be decimal number]:timeout: '
+ '(--parallel -p)'{--parallel,-p}'[run tests in parallel for all servers (may be inaccurate, depends on GNU parallel)]'
'(--repo -r)'{--repo,-r}'[specify a repository name instead of guessing]'
'(--times -t)'{--times,-t}'[only output mirrors and their response times]'
'(--url -u)'{--url,-u}'[test a specific UR]'
'(--verbose -v)'{--verbose,-v}'[be verbose in output]'
- '(-)--version[show program'\''s version number and exit]'
- '(-)'{--help,-h}'[show help message and exit]'
+ '(-)'{--help,-h}'[display help message and exit]'
+ '(-)'{--version, -V}'[display version information and exit]'
':mirror file or URL:{_alternative files:file:_files urls:url:_urls}'
)
diff --git a/completions/zsh/_updpkgsums b/completions/zsh/_updpkgsums
index 7ab94d1..5d40a5a 100644
--- a/completions/zsh/_updpkgsums
+++ b/completions/zsh/_updpkgsums
@@ -2,8 +2,8 @@
declare -a args
args=(
+ '(--nocolor -m)'{--nocolor,-m}'[do not colorize output]'
'(-)'{--help,-h}'[display help message and exit]'
- '(--nocolor -m)'{--nocolor,-m}'[disable colorized output messages]'
'(-)'{--version,-V}'[display version information and exit]'
'::build file:_files'
diff --git a/doc/checkupdates.8.adoc b/doc/checkupdates.8.adoc
index 17844b4..fa394bc 100644
--- a/doc/checkupdates.8.adoc
+++ b/doc/checkupdates.8.adoc
@@ -13,9 +13,9 @@ Synopsis
Description
-----------
-Checks for pending updates using a separate Pacman database located in
-*`TMPDIR`* if *`CHECKUPDATES_DB`* is not set and outputs a list of updates with the
-old and new version.
+'checkupdates' checks for pending updates using a separate pacman database
+located in *`TMPDIR`* if *`CHECKUPDATES_DB`* is not set and outputs a list of
+updates with the old and new version.
Options
@@ -23,21 +23,29 @@ Options
*-d, \--download*::
Download any pending updates to the pacman cache.
+*-h, \--help*::
+ Display syntax and command-line options.
+
+\--nocolor*::
+ Do not colorize output.
+
*-n, \--nosync*::
- Do not sync the temporary database, works best when the temporary database is
- updated regularly through some other means such as a cronjob or systemd timer.
+ Do not sync the temporary database, works best when the temporary database
+ is updated regularly through some other means such as a cronjob or systemd
+ timer.
-*-h, \--help*::
- Display syntax and command line options.
+*-V, \--version*::
+ Display version information.
Environment
-----------
*CHECKUPDATES_DB*::
- Override the default update db location.
+ Override the default '$\{TMPDIR:-/tmp}/checkup-db-$\{UID}' temporary
+ database location.
*TMPDIR*::
- Overrides the default '/tmp' temporary directory.
+ Override the default '/tmp' temporary directory.
Errors
diff --git a/doc/paccache.8.adoc b/doc/paccache.8.adoc
index 9d84dc7..bc950a0 100644
--- a/doc/paccache.8.adoc
+++ b/doc/paccache.8.adoc
@@ -8,12 +8,12 @@ paccache - flexible pacman cache cleaning utility
Synopsis
--------
-'paccache' <operation> [options] [targets...]
+'paccache' <operation> [options] [target ...]
Description
-----------
-Paccache removes old packages from the pacman cache directory.
+'paccache' removes old packages from the pacman cache directory.
By default the last three versions of a package are kept.
@@ -32,15 +32,8 @@ Operations
Options
-------
*-a, \--arch <arch>*::
- Scan for packages for a specific architecture. Default is to scan for
- all architectures.
-
-*\--min-atime <time>*::
-*\--min-mtime <time>*::
- Keep packages with an atime/mtime that is not older than the time given,
- even if this means keeping more than specified through the '--keep' option.
- Accepts arguments according to 'info "Date input formats"', e.g. '30 days
- ago'.
+ Scan for packages for a specific architecture. Default is to scan for all
+ architectures.
*-c, \--cachedir <dir>*::
Specify a different cache directory. This option can be used more than once.
@@ -50,7 +43,7 @@ Options
Apply force to 'mv' and 'rm' operations.
*-h, \--help*::
- Display syntax and command line options.
+ Display syntax and command-line options.
*-i, \--ignore <pkgs>*::
Specify packages to ignore, comma-separated. Alternatively "-" can be used
@@ -60,8 +53,18 @@ Options
Specify how many versions of each package are kept in the cache directory,
default is 3.
+*\--min-atime <time>*::
+*\--min-mtime <time>*::
+ Keep packages with an atime/mtime that is not older than the time given,
+ even if this means keeping more than specified through the '--keep' option.
+ Accepts arguments according to 'info "Date input formats"', e.g. '30 days
+ ago'.
+
*\--nocolor*::
- Remove color from the output.
+ Do not colorize output.
+
+*-z, \--null*::
+ Use null delimiters for candidate names (only with -v and -vv).
*-q, \--quiet*::
Minimize the output.
@@ -72,14 +75,15 @@ Options
*-v, \--verbose*::
Increase verbosity, can be specified up to 3 times.
-*-z, \--null*::
- Use null delimiters for candidate names (only with -v and -vv).
+*-V, \--version*::
+ Display version information.
Systemd Timer
-------------
-The package cache can be cleaned periodically using the systemd timer 'paccache.timer'.
-If the timer is enabled the cache will be cleaned weekly with paccache's default options.
+The package cache can be cleaned periodically using the systemd timer
+'paccache.timer'. If the timer is enabled the cache will be cleaned weekly with
+paccache's default options.
See Also
diff --git a/doc/pacdiff.8.adoc b/doc/pacdiff.8.adoc
index 189b0b0..3ad4d32 100644
--- a/doc/pacdiff.8.adoc
+++ b/doc/pacdiff.8.adoc
@@ -13,52 +13,63 @@ Synopsis
Description
-----------
-pacdiff is a script which looks for pacorig, pacnew and pacsave files from the
-backup entries found in the local Pacman db. For every found file the option is
+'pacdiff' is a script which looks for pacorig, pacnew and pacsave files from the
+backup entries found in the local pacman db. For every found file the option is
given to view, merge, skip, diff, remove or overwrite the found pacorig, pacnew
or pacsave file.
-Environment
------------
-*DIFFPROG*::
- Override the default 'vim -d' merge program.
-
-*DIFFSEARCHPATH*::
- Override the default search path '/etc', only when using find.
-
-*MERGEPROG*::
- Override the default 'diff3 -m' 3-way merge program. One possible
- alternative is 'git merge-file -p'.
-
Options
-------
-*-l, \--locate*::
- Scan using locate.
+Search Options
+~~~~~~~~~~~~~~
*-f, \--find*::
Scan using find.
-*-p, \--pacmandb*::
- Scan active config files from Pacman database. (default)
+*-l, \--locate*::
+ Scan using locate.
-*-o, \--output*::
- Print files instead of merging them.
+*-p, \--pacmandb*::
+ Scan active config files from pacman database. (default)
-*\--nocolor*::
- Remove colors from output.
+General Options
+~~~~~~~~~~~~~~~
+*-b, \--backup*::
+ When overwriting, save old files with .bak.
*-c, \--cachedir <dir>*::
Scan 'dir' instead as the pacman cache for 3-way merge base candidates.
+*-h, \--help*::
+ Display syntax and command-line options.
+
+*\--nocolor*::
+ Do not colorize output.
+
+*-o, \--output*::
+ Print files instead of merging them.
+
*-s, \--sudo*::
Use sudo and sudoedit to merge/remove files.
-*-b, \--backup*::
- When overwriting, save old files with .bak.
-
*-3, \--threeway*::
View diffs in 3-way fashion if the base package is available in the cache.
- Fall back to regular 2-way diff otherwise.
+ Fall back to regular 2-way diff otherwise.
+
+*-V, \--version*::
+ Display version information.
+
+Environment
+-----------
+*DIFFPROG*::
+ Override the default 'vim -d' merge program.
+
+*DIFFSEARCHPATH*::
+ Override the default search path '/etc', only when using find.
+
+*MERGEPROG*::
+ Override the default 'diff3 -m' 3-way merge program. One possible
+ alternative is 'git merge-file -p'.
See Also
--------
diff --git a/doc/pacsort.8.adoc b/doc/pacsort.8.adoc
index a6f498d..65ac265 100644
--- a/doc/pacsort.8.adoc
+++ b/doc/pacsort.8.adoc
@@ -8,7 +8,7 @@ pacsort - sort utility implementing alpm_pkg_vercmp
Synopsis
--------
-'pacsort' [options] [files...]
+'pacsort' [options] [files ...]
Description
@@ -24,26 +24,27 @@ By default the lines are treated as lists of plain version strings.
Options
-------
*-f, \--files*::
- If the input lists are in the format '\*-\*.pkg.tar*', sort lines by pkgname and pkgver.
+ If the input lists are in the format '\*-\*.pkg.tar*', sort lines by pkgname
+ and pkgver.
*-h, \--help*::
- Display syntax and command line options.
+ Display syntax and command-line options.
*-k, \--key <index>*::
Sort the input starting on the specified column.
+*-z, \--null*::
+ Lines end with null bytes rather than newlines.
+
*-r, \--reverse*::
Sort in reverse order.
*-t, \--separator <sep>*::
Field separator. Default separator is space.
-*-v, \--version*::
+*-V, \--version*::
Display the version.
-*-z, \--null*::
- Lines end with null bytes rather than newlines.
-
See Also
--------
diff --git a/doc/pactree.8.adoc b/doc/pactree.8.adoc
index 7fe0bc4..eda1b8a 100644
--- a/doc/pactree.8.adoc
+++ b/doc/pactree.8.adoc
@@ -8,44 +8,60 @@ pactree - package dependency tree viewer
Synopsis
--------
-'pactree' [options] package
+'pactree' [options] <package>
Description
-----------
-Pactree produces a dependency tree for a package.
+'pactree' produces a dependency tree for a package.
-By default, a tree-like output is generated, but with the '\--graph' option, a Graphviz
-description is generated.
+By default, a tree-like output is generated, but with the '\--graph' option, a
+Graphviz description is generated.
Options
-------
*-a, \--ascii*::
- Use ASCII characters for tree formatting. By default, pactree will use Unicode
- line drawing characters if it is able to detect that the locale supports them.
+ Use ASCII characters for tree formatting. By default, pactree will use
+ Unicode line drawing characters if it is able to detect that the locale
+ supports them.
+
+*-c, \--color*::
+ Colorize output.
+
+*\--config <file>*::
+ Specify an alternate pacman configuration file.
*-b, \--dbpath*::
Specify an alternative database location.
-*-c, \--color*::
- Colorize output.
+*\--debug*::
+ Print log messages produced by libalpm.
*-d, \--depth <num>*::
- Limits the number of levels of dependency to show. A zero means
- show the named package only, one shows the packages that are directly
- required.
+ Limits the number of levels of dependency to show. A zero means show the
+ named package only, one shows the packages that are directly required.
+
+*\--gpgdir <dir>*::
+ Specify an alternate GnuPG directory for verifying database signatures
+ (default is /etc/pacman.d/gnupg).
*-g, \--graph*::
Generate a Graphviz description. If this option is given, the '\--color' and
'\--linear' options are ignored.
*-h, \--help*::
- Output syntax and command-line options.
+ Display syntax and command-line options.
*-l, \--linear*::
Prints package names at the start of each line, one per line.
+*-o, \--optional[=depth]*::
+ Additionally prints optional dependencies up to a certain depth, default 1
+ for immediate optional dependencies. When used in conjunction with '-r' it
+ shows which packages it is optional for. In Graphviz mode, produce dotted
+ lines. Negative values mean infinite depth.
+
*-r, \--reverse*::
Show packages that depend on the named package.
@@ -55,22 +71,6 @@ Options
*-u, \--unique*::
List dependent packages once. Implies '\--linear'.
-*-o, \--optional[=DEPTH]*::
- Additionally prints optional dependencies up to a certain depth, default 1
- for immediate optional dependencies. When used in conjunction with '-r' it
- shows which packages it is optional for. In Graphviz mode, produce dotted
- lines. Negative values mean infinite depth.
-
-*\--config <file>*::
- Specify an alternate pacman configuration file.
-
-*\--debug*::
- Print log messages produced by libalpm.
-
-*\--gpgdir <dir>*::
- Specify an alternate GnuPG directory for verifying database signatures
- (default is /etc/pacman.d/gnupg).
-
See Also
--------
diff --git a/doc/updpkgsums.8.adoc b/doc/updpkgsums.8.adoc
index 8279b41..e3eb29c 100644
--- a/doc/updpkgsums.8.adoc
+++ b/doc/updpkgsums.8.adoc
@@ -20,11 +20,14 @@ directory.
Options
-------
-*-V, \--version*::
- Display version information and exit.
+*-h, \--help*::
+ Display syntax and command-line options.
*-m, \--nocolor*::
- Disable colorized output messages.
+ Do not colorize output.
+
+*-V, \--version*::
+ Display version information and exit.
See Also
diff --git a/src/checkupdates.sh.in b/src/checkupdates.sh.in
index 7fa47ba..1e3febe 100644
--- a/src/checkupdates.sh.in
+++ b/src/checkupdates.sh.in
@@ -24,7 +24,7 @@ declare -r myver='@PACKAGE_VERSION@'
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
DOWNLOAD_CACHE=0
-USE_COLOR=0
+USE_COLOR='y'
# Import libmakepkg
source "$LIBRARY"/util/message.sh
@@ -49,25 +49,33 @@ runcmd() {
}
usage() {
- cat << __EOF__
+ cat <<EOF
${myname} v${myver}
-Safely print a list of pending updates
+Safely print a list of pending updates.
Usage: ${myname} [options]
- Options:
- -d, --download download pending updates to the pacman cache.
- -n, --nosync do not sync the temporary database.
- -h, --help display this help message and exit.
-
-Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.
+Options:
+ -d, --download download pending updates to the pacman cache
+ --nocolor do not colorize output
+ -n, --nosync do not sync the temporary database
+ -h, --help display this help message and exit
+ -V, --version display version information and exit
+
+Environment Variables:
+ CHECKUPDATES_DB override the path of the temporary database
+ (default: "\${TMPDIR:-/tmp}/checkup-db-\${UID}")
+ TMPDIR override the temporary directory (default: '/tmp')
+EOF
+}
-__EOF__
+version() {
+ printf "%s %s\n" "$myname" "$myver"
}
-OPT_SHORT='dnh'
-OPT_LONG=('download' 'nosync' 'help' 'nocolor')
+OPT_SHORT='dnhV'
+OPT_LONG=('download' 'nosync' 'help' 'nocolor' 'version')
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
exit 1
@@ -80,13 +88,16 @@ while :; do
case $1 in
-d|--download)
DOWNLOAD_CACHE=1 ;;
+ --nocolor)
+ USE_COLOR='n';;
-n|--nosync)
SYNC=0 ;;
-h|--help)
usage
exit 0 ;;
- --nocolor)
- USE_COLOR='n';;
+ -V|--version)
+ version
+ exit 0 ;;
--)
shift
break ;;
diff --git a/src/paccache.sh.in b/src/paccache.sh.in
index 30f72f1..2f74539 100644
--- a/src/paccache.sh.in
+++ b/src/paccache.sh.in
@@ -56,7 +56,7 @@ pkgfilter() {
}
function parse_filename(filename,
- atime, mtime, parts, count, i, pkgname, arch) {
+ atime, mtime, parts, count, i, pkgname, arch) {
if (0 + min_atime + min_mtime != 0) {
# atime and mtime are in the first two columns and the
@@ -189,38 +189,38 @@ usage() {
cat <<EOF
${myname} v${myver}
-A flexible pacman cache cleaning utility.
+Flexible pacman cache cleaning utility.
-Usage: ${myname} <operation> [options] [targets...]
+Usage: ${myname} <operation> [options] [target ...]
- Operations:
- -d, --dryrun perform a dry run, only finding candidate packages.
- -m, --move <dir> move candidate packages to "dir".
- -r, --remove remove candidate packages.
+Operations:
+ -d, --dryrun perform a dry run, only finding candidate packages
+ -m, --move <dir> move candidate packages to "dir"
+ -r, --remove remove candidate packages
- Options:
- --min-atime <time>
- --min-mtime <time> keep packages with an atime/mtime that is not older
+Options:
+ -a, --arch <arch> scan for "arch" (default: all architectures)
+ -c, --cachedir <dir> scan "dir" for packages. can be used more than once
+ (default: read from @sysconfdir@/pacman.conf)
+ -f, --force apply force to mv(1) and rm(1) operations
+ -i, --ignore <pkgs> ignore "pkgs", comma-separated. Alternatively, specify
+ "-" to read package names from stdin, newline-
+ delimited
+ -k, --keep <num> keep "num" of each package in the cache (default: 3)
+ --min-atime <time>
+ --min-mtime <time> keep packages with an atime/mtime that is not older
than the time given, even if this means keeping more
than specified through the '--keep' option. Accepts
arguments according to 'info "Date input formats"',
- e.g. '30 days ago'.
- -a, --arch <arch> scan for "arch" (default: all architectures).
- -c, --cachedir <dir> scan "dir" for packages. can be used more than once.
- (default: read from @sysconfdir@/pacman.conf).
- -f, --force apply force to mv(1) and rm(1) operations.
- -h, --help display this help message and exit.
- -i, --ignore <pkgs> ignore "pkgs", comma-separated. Alternatively, specify
- "-" to read package names from stdin, newline-
- delimited.
- -k, --keep <num> keep "num" of each package in the cache (default: 3).
- --nocolor remove color from output.
- -q, --quiet minimize output
- -u, --uninstalled target uninstalled packages.
- -v, --verbose increase verbosity. specify up to 3 times.
- -z, --null use null delimiters for candidate names (only with -v
- and -vv).
-
+ e.g. '30 days ago'
+ --nocolor do not colorize output
+ -z, --null use null delimiters for candidate names (only with -v
+ and -vv)
+ -q, --quiet minimize output
+ -u, --uninstalled target uninstalled packages
+ -v, --verbose increase verbosity. specify up to 3 times
+ -h, --help display this help message and exit
+ -V, --version display version information and exit
EOF
}
@@ -242,18 +242,6 @@ unset OPT_SHORT OPT_LONG OPTRET
while :; do
case $1 in
- --min-atime)
- min_atime=$(date -d "$2" +%s)
- if (( $? )); then
- die "argument to option --min-atime must be of the form described by 'info \"Date input formats\" '."
- fi
- shift ;;
- --min-mtime)
- min_mtime=$(date -d "$2" +%s)
- if (( $? )); then
- die "argument to option --min-mtime must be of the form described by 'info \"Date input formats\" '."
- fi
- shift ;;
-a|--arch)
scanarch=$2
shift ;;
@@ -264,9 +252,6 @@ while :; do
dryrun=1 ;;
-f|--force)
cmdopts=(-f) ;;
- -h|--help)
- usage
- exit 0 ;;
-i|--ignore)
if [[ $2 = '-' ]]; then
[[ ! -t 0 ]] && IFS=$'\n' read -r -d '' -a ign
@@ -284,11 +269,25 @@ while :; do
keep=$(( 10#$keep ))
fi
shift ;;
+ --min-atime)
+ min_atime=$(date -d "$2" +%s)
+ if (( $? )); then
+ die "argument to option --min-atime must be of the form described by 'info \"Date input formats\" '."
+ fi
+ shift ;;
+ --min-mtime)
+ min_mtime=$(date -d "$2" +%s)
+ if (( $? )); then
+ die "argument to option --min-mtime must be of the form described by 'info \"Date input formats\" '."
+ fi
+ shift ;;
-m|--move)
move=1 movedir=$2
shift ;;
--nocolor)
USE_COLOR='n' ;;
+ -z|--null)
+ delim='\0' ;;
-q|--quiet)
QUIET=1 ;;
-r|--remove)
@@ -299,13 +298,14 @@ while :; do
(( ${#ign[@]} )) || die 'failed to retrieve the list of installed packages'
blacklist+=("${ign[@]}")
unset ign ;;
+ -v|--verbose)
+ (( ++verbose )) ;;
+ -h|--help)
+ usage
+ exit 0 ;;
-V|--version)
version
exit 0 ;;
- -v|--verbose)
- (( ++verbose )) ;;
- -z|--null)
- delim='\0' ;;
--)
shift
break 2 ;;
diff --git a/src/pacdiff.sh.in b/src/pacdiff.sh.in
index 685b5a2..a59aaa4 100644
--- a/src/pacdiff.sh.in
+++ b/src/pacdiff.sh.in
@@ -46,33 +46,34 @@ usage() {
cat <<EOF
${myname} v${myver}
-A simple program to merge or remove pacnew/pacsave files.
+pacorig, pacnew and pacsave maintenance utility.
-Usage: $myname [-l | -f | -p] [--nocolor]
+Usage: $myname [options]
-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
+Search Options: select one (default: --pacmandb)
+ -f, --find scan using find
+ -l, --locate scan using locate
+ -p, --pacmandb scan active config files from pacman database
General Options:
- -o/--output print files instead of merging them
- --nocolor remove colors from output
- -c/--cachedir <dir> scan "dir" for 3-way merge base candidates.
- (default: read from @sysconfdir@/pacman.conf)
- -s/--sudo use sudo and sudoedit to merge/remove files
- -b/--backup when overwriting, save old files with .bak
- -3/--threeway view diffs in 3-way fashion
+ -b, --backup when overwriting, save old files with .bak
+ -c, --cachedir <dir> scan "dir" for 3-way merge base candidates
+ (default: read from @sysconfdir@/pacman.conf)
+ --nocolor do not colorize output
+ -o, --output print files instead of merging them
+ -s, --sudo use sudo and sudoedit to merge/remove files
+ -3, --threeway view diffs in 3-way fashion
+ -h, --help show this help message and exit
+ -V, --version display version information and exit
Environment Variables:
- DIFFPROG override the merge program: (default: 'vim -d')
- DIFFSEARCHPATH override the search path. (only when using find)
- (default: /etc)
- MERGEPROG override the 3-way merge program: (default: 'diff3 -m')
+ DIFFPROG override the merge program (default: 'vim -d')
+ DIFFSEARCHPATH override the search path (only when using find)
+ (default: /etc)
+ MERGEPROG override the 3-way merge program (default: 'diff3 -m')
Example: DIFFPROG=meld DIFFSEARCHPATH="/boot /etc /usr" MERGEPROG="git merge-file -p" $myname
Example: $myname --output --locate
-
EOF
}
@@ -231,22 +232,22 @@ cmd() {
while [[ -n "$1" ]]; do
case "$1" in
- -l|--locate)
- USE_LOCATE=1;;
-f|--find)
USE_FIND=1;;
+ -l|--locate)
+ USE_LOCATE=1;;
-p|--pacmandb)
USE_PACDB=1;;
- -o|--output)
- OUTPUTONLY=1;;
- --nocolor)
- USE_COLOR='n';;
+ -b|--backup)
+ BACKUP=1;;
-c|--cachedir)
cachedir="$2"; shift;;
+ --nocolor)
+ USE_COLOR='n';;
+ -o|--output)
+ OUTPUTONLY=1;;
-s|--sudo)
SUDO=sudo;;
- -b|--backup)
- BACKUP=1;;
-3|--threeway)
THREE_WAY_DIFF=1 ;;
-V|--version)
diff --git a/src/paclist.sh.in b/src/paclist.sh.in
index 672728a..0de54f9 100644
--- a/src/paclist.sh.in
+++ b/src/paclist.sh.in
@@ -21,13 +21,19 @@ declare -r myname='paclist'
declare -r myver='@PACKAGE_VERSION@'
usage() {
- printf "%s v%s\n" "${myname}" "${myver}"
- echo
- printf "List all packages installed from a given repository\n" "${myname}"
- echo
- printf "Usage: %s <repository> ...\n" "${myname}"
- echo
- printf "Example: %s testing\n" "${myname}"
+ cat <<EOF
+${myname} v${myver}
+
+List all packages installed from a given repository.
+
+Usage: ${myname} <repository ...>
+
+Options:
+ -h, --help show this help message and exit
+ -V, --version display version information and exit
+
+Example: ${myname} testing
+EOF
}
version() {
diff --git a/src/paclog-pkglist.sh.in b/src/paclog-pkglist.sh.in
index ec7323a..e9e2a23 100644
--- a/src/paclog-pkglist.sh.in
+++ b/src/paclog-pkglist.sh.in
@@ -25,15 +25,21 @@ export TEXTDOMAINDIR='/usr/share/locale'
declare logfile=${1:-@localstatedir@/log/pacman.log}
usage() {
- printf "%s v%s\n" "${myname}" "${myver}"
- echo
- echo "Parse a log file into a list of currently installed packages"
- echo
- printf "Usage: %s [path to pacman log]\n" "${myname}"
- echo
- printf "Example: %s @localstatedir@/log/pacman.log\n" "${myname}"
- echo
- echo 'Defaults to: @localstatedir@/log/pacman.log'
+ cat <<EOF
+${myname} v${myver}
+
+Parse a log file into a list of currently installed packages.
+
+Usage: ${myname} [path to pacman log]
+
+Options:
+ -h, --help show this help message and exit
+ -V, --version display version information and exit
+
+Example: ${myname} @localstatedir@/log/pacman.log
+
+Defaults to: @localstatedir@/log/pacman.log
+EOF
}
version() {
diff --git a/src/pacscripts.sh.in b/src/pacscripts.sh.in
index ee4afa8..7c6d67d 100644
--- a/src/pacscripts.sh.in
+++ b/src/pacscripts.sh.in
@@ -33,18 +33,20 @@ error() {
}
usage() {
- echo "${myname} v${myver}"
- echo
- echo "Prints the {pre,post}_{install,remove,upgrade} scripts of a given package."
- echo
- echo "Usage: ${myname} <pkgname|pkgfile>"
- echo
- echo " Options:"
- echo " -h, --help Print this help message"
- echo " -v, --version Print program name and version"
- echo
- echo "Example: ${myname} gconf-editor"
- echo "Example: ${myname} gconf-editor-3.0.1-3-x86_64.pkg.tar.xz"
+ cat <<EOF
+${myname} v${myver}
+
+Print the {pre,post}_{install,remove,upgrade} scripts of a given package.
+
+Usage: ${myname} <pkgname | pkgfile>
+
+Options:
+ -h, --help show this help message and exit
+ -V, --version display version information and exit
+
+Example: ${myname} gconf-editor
+Example: ${myname} gconf-editor-3.0.1-3-x86_64.pkg.tar.xz
+EOF
}
@@ -130,6 +132,6 @@ fi
case "$1" in
--help|-h) usage; exit 0 ;;
- --version|-v) version; exit 0 ;;
+ --version|-V) version; exit 0 ;;
*) print_scriptlet $1 ;;
esac
diff --git a/src/pacsearch.pl.in b/src/pacsearch.pl.in
index 21b65aa..3f4492a 100644
--- a/src/pacsearch.pl.in
+++ b/src/pacsearch.pl.in
@@ -31,7 +31,9 @@ sub usage {
print "Perform a pacman search using both the local and the sync databases.\n\n";
print "Usage: $myname [-n] <pattern>\n\n";
print "Options:\n";
- print " -n, --nocolor: turn off coloring\n\n";
+ print " -n, --nocolor do not colorize output\n";
+ print " -h, --help display this help message and exit\n";
+ print " -V, --version display version information and exit\n\n";
print "Example: $myname ^gnome\n";
}
diff --git a/src/pacsort.c b/src/pacsort.c
index 20d2f12..5d0a3f0 100644
--- a/src/pacsort.c
+++ b/src/pacsort.c
@@ -420,18 +420,19 @@ static char escape_char(const char *string)
static void usage(void)
{
printf("pacsort v" PACKAGE_VERSION "\n\n"
- "A sort utility implementing alpm_pkg_vercmp.\n\n"
- "Usage: pacsort [options] [files...]\n\n"
- " -f, --files assume inputs are file paths of packages\n"
- " -h, --help display this help message\n"
- " -k, --key <index> sort input starting on specified column\n"
- " -r, --reverse sort in reverse order (default: oldest to newest)\n"
- " -t, --separator <sep> specify field separator (default: space)\n"
- " -v, --version display the version\n"
- " -z, --null lines end with null bytes, not newlines\n\n"
+ "Sort utility implementing alpm_pkg_vercmp.\n\n"
+ "Usage: pacsort [options] [files ...]\n\n"
+ "Options:\n"
+ " -f, --files assume inputs are file paths of packages\n"
+ " -k, --key <index> sort input starting on specified column\n"
+ " -z, --null lines end with null bytes, not newlines\n"
+ " -r, --reverse sort in reverse order (default: oldest to newest)\n"
+ " -t, --separator <sep> specify field separator (default: space)\n"
+ " -h, --help display this help message and exit\n"
+ " -V, --version display version information and exit\n\n"
"pacsort writes the sorted concatenation of all files, to standard output.\n"
"Files should contain a list of inputs to sort.\n\n"
- "Standard input is read when no files are given.\n\n");
+ "Standard input is read when no files are given.\n");
}
static void version(void)
@@ -449,7 +450,7 @@ static int parse_options(int argc, char **argv)
{"key", required_argument, 0, 'k'},
{"reverse", no_argument, 0, 'r'},
{"separator", required_argument, 0, 't'},
- {"version", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
{"null", no_argument, 0, 'z'},
{0, 0, 0, 0}
};
@@ -459,9 +460,6 @@ static int parse_options(int argc, char **argv)
case 'f':
opts.filemode = 1;
break;
- case 'h':
- opts.help = 1;
- return 0;
case 'k':
opts.sortkey = (int)strtol(optarg, NULL, 10);
if(opts.sortkey <= 0) {
@@ -479,12 +477,15 @@ static int parse_options(int argc, char **argv)
return 1;
}
break;
- case 'v':
- opts.version = 1;
- return 0;
case 'z':
opts.null = 1;
break;
+ case 'h':
+ opts.help = 1;
+ return 0;
+ case 'V':
+ opts.version = 1;
+ return 0;
default:
return 1;
}
diff --git a/src/pactree.c b/src/pactree.c
index 23cffb3..f0cbf5c 100644
--- a/src/pactree.c
+++ b/src/pactree.c
@@ -250,24 +250,25 @@ static void cleanup(int ret)
static void usage(void)
{
fprintf(stdout, "pactree v" PACKAGE_VERSION "\n\n"
- "A simple dependency tree viewer.\n\n"
- "Usage: pactree [options] PACKAGE\n\n"
- " -a, --ascii use ASCII characters for tree formatting\n"
- " -b, --dbpath <path> set an alternate database location\n"
- " -c, --color colorize output\n"
- " -d, --depth <#> limit the depth of recursion\n"
- " -g, --graph generate output for graphviz's dot\n"
- " -h, --help display this help message\n"
- " -l, --linear enable linear output\n"
- " -r, --reverse list packages that depend on the named package\n"
- " -s, --sync search sync databases instead of local\n"
- " -u, --unique show dependencies with no duplicates (implies -l)\n"
- " -o, --optional[=DEPTH] controls at which depth to stop printing optional deps\n"
- " (-1 for no limit)\n"
- " -v, --version display the version\n"
- " --config <path> set an alternate configuration file\n"
- " --debug display debug messages\n"
- " --gpgdir <path> set an alternate home directory for GnuPG\n");
+ "Package dependency tree viewer.\n\n"
+ "Usage: pactree [options] <package>\n\n"
+ "Options:\n"
+ " -a, --ascii use ASCII characters for tree formatting\n"
+ " -c, --color colorize output\n"
+ " --config <path> set an alternate configuration file\n"
+ " -b, --dbpath <path> set an alternate database location\n"
+ " --debug display debug messages\n"
+ " -d, --depth <#> limit the depth of recursion\n"
+ " --gpgdir <path> set an alternate home directory for GnuPG\n"
+ " -g, --graph generate output for graphviz's dot\n"
+ " -l, --linear enable linear output\n"
+ " -o, --optional[=depth] controls at which depth to stop printing optional deps\n"
+ " (-1 for no limit)\n"
+ " -r, --reverse list packages that depend on the named package\n"
+ " -s, --sync search sync databases instead of local\n"
+ " -u, --unique show dependencies with no duplicates (implies -l)\n"
+ " -h, --help display this help message and exit\n"
+ " -V, --version display version information and exit\n");
}
static void version(void)
@@ -281,18 +282,18 @@ static int parse_options(int argc, char *argv[])
char *endptr = NULL;
static const struct option opts[] = {
- {"ascii", no_argument, 0, 'a'},
- {"dbpath", required_argument, 0, 'b'},
- {"color", no_argument, 0, 'c'},
- {"depth", required_argument, 0, 'd'},
- {"graph", no_argument, 0, 'g'},
- {"help", no_argument, 0, 'h'},
- {"linear", no_argument, 0, 'l'},
- {"reverse", no_argument, 0, 'r'},
- {"sync", no_argument, 0, 's'},
- {"unique", no_argument, 0, 'u'},
- {"optional",optional_argument, 0, 'o'},
- {"version", no_argument, 0, 'v'},
+ {"ascii", no_argument, 0, 'a'},
+ {"dbpath", required_argument, 0, 'b'},
+ {"color", no_argument, 0, 'c'},
+ {"depth", required_argument, 0, 'd'},
+ {"graph", no_argument, 0, 'g'},
+ {"help", no_argument, 0, 'h'},
+ {"linear", no_argument, 0, 'l'},
+ {"optional", optional_argument, 0, 'o'},
+ {"reverse", no_argument, 0, 'r'},
+ {"sync", no_argument, 0, 's'},
+ {"unique", no_argument, 0, 'u'},
+ {"version", no_argument, 0, 'V'},
{"config", required_argument, 0, OP_CONFIG},
{"debug", no_argument, 0, OP_DEBUG},
@@ -344,19 +345,6 @@ static int parse_options(int argc, char *argv[])
case 'l':
style = &graph_linear;
break;
- case 'r':
- reverse = 1;
- break;
- case 's':
- searchsyncs = 1;
- break;
- case 'u':
- unique = 1;
- style = &graph_linear;
- break;
- case 'v':
- version();
- cleanup(0);
case 'o':
if(optarg) {
opt_level = (int)strtol(optarg, &endptr, 10);
@@ -368,9 +356,22 @@ static int parse_options(int argc, char *argv[])
opt_level = 1;
}
break;
+ case 'r':
+ reverse = 1;
+ break;
+ case 's':
+ searchsyncs = 1;
+ break;
+ case 'u':
+ unique = 1;
+ style = &graph_linear;
+ break;
case 'h':
usage();
cleanup(0);
+ case 'V':
+ version();
+ cleanup(0);
default:
usage();
return 1;
diff --git a/src/rankmirrors.sh.in b/src/rankmirrors.sh.in
index fe4b885..01e03ed 100644
--- a/src/rankmirrors.sh.in
+++ b/src/rankmirrors.sh.in
@@ -25,33 +25,39 @@ declare -r myname='rankmirrors'
declare -r myver='@PACKAGE_VERSION@'
usage() {
- echo "${myname} v${myver}"
- echo
- echo "Ranks pacman mirrors by their connection and opening speed. Pacman mirror"
- echo "files are located in @sysconfdir@/pacman.d/. It can also rank one mirror if the URL is"
- echo "provided."
- echo
- echo "Usage: ${myname} [options] MIRRORFILE | URL"
- echo
- echo "Options:"
- echo " --version show program's version number and exit"
- echo " -h, --help show this help message and exit"
- echo " -n NUM number of servers to output, 0 for all"
- echo " -m, --max-time NUM specify a ranking operation timeout, can be decimal number"
- echo " -t, --times only output mirrors and their response times"
- echo " -u, --url test a specific URL"
- echo " -v, --verbose be verbose in output"
- echo " -r, --repo specify a repository name instead of guessing"
- echo " -p, --parallel run tests in parallel for all servers (may be inaccurate, depends on GNU parallel)"
+ cat <<EOF
+${myname} v${myver}
+
+Ranks pacman mirrors by their connection and opening speed. Pacman mirror files
+are located in @sysconfdir@/pacman.d/. It can also rank one mirror if the URL is
+provided.
+
+Usage: ${myname} [options] <mirrorfile | url>
+
+Options:
+ -n <num> number of servers to output, 0 for all
+ -m, --max-time <num> specify a ranking operation timeout, can be decimal
+ number
+ -p, --parallel run tests in parallel for all servers (may be
+ inaccurate, depends on GNU parallel)
+ -r, --repo specify a repository name instead of guessing
+ -t, --times only output mirrors and their response times
+ -u, --url test a specific URL
+ -v, --verbose be verbose in output
+ -h, --help display this help message and exit
+ -V, --version display version information and exit
+EOF
exit 0
}
version() {
- echo "${myname} (pacman) ${myver}"
- echo "Copyright (c) 2009 Matthew Bruenig <matthewbruenig@gmail.com>."
- echo
- echo "This is free software; see the source for copying conditions."
- echo "There is NO WARRANTY, to the extent permitted by law."
+ cat <<EOF
+${myname} v${myver}
+Copyright (c) 2009 Matthew Bruenig <matthewbruenig@gmail.com>.
+
+This is free software; see the source for copying conditions.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
exit 0
}
@@ -133,24 +139,24 @@ finaloutput() {
while [[ $1 ]]; do
if [[ ${1:0:2} = -- ]]; then
case "${1:2}" in
- help) usage ;;
- version) version ;;
max-time)
[[ $2 ]] || err "Must specify number.";
MAX_TIME="$2"
shift 2;;
+ parallel) PARALLEL=1 ; shift ;;
+ repo)
+ [[ $2 ]] || err "Must specify repository name.";
+ TARGETREPO="$2";
+ shift 2;;
times) TIMESONLY=1 ; shift ;;
- verbose) VERBOSE=1 ; shift ;;
url)
CHECKURL=1;
[[ $2 ]] || err "Must specify URL.";
URL="$2";
shift 2;;
- repo)
- [[ $2 ]] || err "Must specify repository name.";
- TARGETREPO="$2";
- shift 2;;
- parallel) PARALLEL=1 ; shift ;;
+ verbose) VERBOSE=1 ; shift ;;
+ help) usage ;;
+ version) version ;;
*) err "'$1' is an invalid argument."
esac
elif [[ ${1:0:1} = - ]]; then
@@ -164,27 +170,28 @@ while [[ $1 ]]; do
snum=1
for ((i=1 ; i<${#1}; i++)); do
case ${1:$i:1} in
- h) usage ;;
m)
[[ $2 ]] || err "Must specify number.";
MAX_TIME="$2"
snum=2;;
- t) TIMESONLY=1 ;;
- v) VERBOSE=1 ;;
- u)
- CHECKURL=1;
- [[ $2 ]] || err "Must specify URL.";
- URL="$2";
+ n)
+ [[ $2 ]] || err "Must specify number.";
+ NUM="$2";
snum=2;;
+ p) PARALLEL=1 ;;
r)
[[ $2 ]] || err "Must specify repository name.";
TARGETREPO="$2";
snum=2;;
- n)
- [[ $2 ]] || err "Must specify number.";
- NUM="$2";
+ t) TIMESONLY=1 ;;
+ u)
+ CHECKURL=1;
+ [[ $2 ]] || err "Must specify URL.";
+ URL="$2";
snum=2;;
- p) PARALLEL=1 ;;
+ v) VERBOSE=1 ;;
+ h) usage ;;
+ V) version ;;
*) err "'$1' is an invalid argument." ;;
esac
done
diff --git a/src/updpkgsums.sh.in b/src/updpkgsums.sh.in
index d6a8f57..8c04890 100644
--- a/src/updpkgsums.sh.in
+++ b/src/updpkgsums.sh.in
@@ -28,19 +28,20 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY"/util/schema.sh
usage() {
- printf "%s v%s\n" "${myname}" "${myver}"
- echo
- printf "%s will perform an in place update of the checksums in the\n" "${myname}"
- echo "path specified by [build file], defaulting to PKGBUILD in the current"
- echo "working directory."
- echo
- printf "Usage: %s [options] [build file]\n" "${myname}"
- echo
- echo " -h, --help display this help message and exit"
- echo " -V, --version display version information and exit"
- echo
- echo "These options can be passed to makepkg:"
- echo " -m, --nocolor disable colorized output messages"
+ cat <<EOF
+${myname} v${myver}
+
+Update checksums of a PKGBUILD file.
+
+Usage: ${myname} [options] [build file]
+
+Options:
+ -h, --help display this help message and exit
+ -V, --version display version information and exit
+
+These options can be passed to makepkg:
+ -m, --nocolor do not colorize output
+EOF
}
version() {
@@ -58,8 +59,8 @@ buildfile='PKGBUILD'
while (( "$#" )); do
case "$1" in
- -h|--help) usage; exit ;;
-m|--nocolor) MAKEPKG_OPTS+=("$1"); shift ;;
+ -h|--help) usage; exit ;;
-V|--version) version; exit ;;
*) buildfile="$1"; break 2 ;;
esac