From: Lucas De Marchi Date: Tue, 6 Nov 2012 19:32:41 +0000 (-0200) Subject: tools: make usage() messages go to stdout rather than stderr X-Git-Tag: v11~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34e06bfb545f7a4cce6773b96b602db8329d4009;p=thirdparty%2Fkmod.git tools: make usage() messages go to stdout rather than stderr When user supplied --help/-h, program should output to stdout the usage, not to stderr. It's the expected behavior, what the user asked for, not something to log or an error. --- diff --git a/tools/depmod.c b/tools/depmod.c index 5d94c17e..2107770d 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -89,8 +89,7 @@ static const struct option cmdopts[] = { static void help(void) { - fprintf(stderr, - "Usage:\n" + printf("Usage:\n" "\t%s -[aA] [options] [forced_version]\n" "\n" "If no arguments (except options) are given, \"depmod -a\" is assumed\n" diff --git a/tools/insmod.c b/tools/insmod.c index bc7115f9..c05a6fc0 100644 --- a/tools/insmod.c +++ b/tools/insmod.c @@ -38,8 +38,7 @@ static const struct option cmdopts[] = { static void help(void) { - fprintf(stderr, - "Usage:\n" + printf("Usage:\n" "\t%s [options] filename [args]\n" "Options:\n" "\t-V, --version show version\n" diff --git a/tools/modinfo.c b/tools/modinfo.c index c6a12aee..f770ec9b 100644 --- a/tools/modinfo.c +++ b/tools/modinfo.c @@ -330,8 +330,7 @@ static const struct option cmdopts[] = { static void help(void) { - fprintf(stderr, - "Usage:\n" + printf("Usage:\n" "\t%s [options] filename [args]\n" "Options:\n" "\t-a, --author Print only 'author'\n" diff --git a/tools/modprobe.c b/tools/modprobe.c index 4cd66459..0dea8787 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -93,8 +93,7 @@ static const struct option cmdopts[] = { static void help(void) { - fprintf(stderr, - "Usage:\n" + printf("Usage:\n" "\t%s [options] [-i] [-b] modulename\n" "\t%s [options] -a [-i] [-b] modulename [modulename...]\n" "\t%s [options] -r [-i] modulename\n" diff --git a/tools/rmmod.c b/tools/rmmod.c index 9d095157..689675b5 100644 --- a/tools/rmmod.c +++ b/tools/rmmod.c @@ -48,8 +48,7 @@ static const struct option cmdopts[] = { static void help(void) { - fprintf(stderr, - "Usage:\n" + printf("Usage:\n" "\t%s [options] modulename ...\n" "Options:\n" "\t-f, --force forces a module unload and may crash your\n"