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/testpkg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util/testpkg.c') diff --git a/src/util/testpkg.c b/src/util/testpkg.c index 10b2f2c2..d1b75ac5 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -22,8 +22,6 @@ #include -#define BASENAME "testpkg" - __attribute__((format(printf, 2, 0))) static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args) { @@ -47,7 +45,9 @@ int main(int argc, char *argv[]) const alpm_siglevel_t level = ALPM_SIG_PACKAGE | ALPM_SIG_PACKAGE_OPTIONAL; if(argc != 2) { - fprintf(stderr, "usage: %s \n", BASENAME); + fprintf(stderr, "testpkg (pacman) v" PACKAGE_VERSION "\n\n" + "Test a pacman package for validity.\n\n" + "Usage: testpkg \n"); return 1; } -- cgit v1.2.3-54-g00ecf