From a86015f73fdda878287a2ad21011594862bf506a Mon Sep 17 00:00:00 2001 From: "Jason St. John" Date: Tue, 3 Sep 2013 15:20:50 -0400 Subject: Improve --help switch output for pacman utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unify the formatting of the --help switch for pacman utils, if it exists. All of the pacman utils will now output help text using the following format: util-name (pacman) v one line description of util's purpose Usage: util-name [options] -b, --bar whatever --bar does -f, --foo whatever --foo does -h, --help display this help message The --help switch does not exist for a couple of the utils, so the help/usage text for those will be displayed when the util is run with no arguments. Reported-by: Karol Błażewicz Signed-off-by: Jason St. John Signed-off-by: Allan McRae --- src/util/vercmp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/util/vercmp.c') diff --git a/src/util/vercmp.c b/src/util/vercmp.c index f4356fb4..41a4f8e2 100644 --- a/src/util/vercmp.c +++ b/src/util/vercmp.c @@ -1,5 +1,6 @@ /* - * vercmp.c + * vercmp.c - Compare package version numbers using pacman's version + * comparison logic * * Copyright (c) 2006-2011 Pacman Development Team * Copyright (c) 2002-2005 by Judd Vinet @@ -22,19 +23,19 @@ #include /* printf */ #include -#define BASENAME "vercmp" - /* forward declaration, comes from version.o in libalpm source that is linked * in directly so we don't have any library deps */ int alpm_pkg_vercmp(const char *a, const char *b); static void usage(void) { - fprintf(stderr, "usage: %s \n\n", BASENAME); - fprintf(stderr, "output values:\n"); - fprintf(stderr, " < 0 : if ver1 < ver2\n"); - fprintf(stderr, " 0 : if ver1 == ver2\n"); - fprintf(stderr, " > 0 : if ver1 > ver2\n"); + fprintf(stderr, "vercmp (pacman) v" PACKAGE_VERSION "\n\n" + "Compare package version numbers using pacman's version comparison logic.\n\n" + "Usage: vercmp \n\n" + "Output values:\n" + " < 0 : if ver1 < ver2\n" + " 0 : if ver1 == ver2\n" + " > 0 : if ver1 > ver2\n"); } int main(int argc, char *argv[]) -- cgit v1.2.3-54-g00ecf