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/testdb.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/util/testdb.c') diff --git a/src/util/testdb.c b/src/util/testdb.c index 0ca7ffc8..3d341b35 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -27,8 +27,6 @@ #include #include -#define BASENAME "testdb" - alpm_handle_t *handle = NULL; static void cleanup(int signum) @@ -244,11 +242,11 @@ cleanup: static void usage(void) { - fprintf(stderr, "usage:\n"); - fprintf(stderr, - "\t%s [-b ] : check the local database\n", BASENAME); - fprintf(stderr, - "\t%s [-b ] core extra ... : check the listed sync databases\n", BASENAME); + fprintf(stderr, "testdb (pacman) v" PACKAGE_VERSION "\n\n" + "Test a pacman local database for validity.\n\n" + "Usage: testdb [options]\n\n" + " -b : check the local database\n" + " -b core extra ... : check the listed sync databases\n"); exit(1); } -- cgit v1.2.3-24-g4f1b