From 34e06bfb545f7a4cce6773b96b602db8329d4009 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 6 Nov 2012 17:32:41 -0200 Subject: [PATCH] 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. --- tools/depmod.c | 3 +-- tools/insmod.c | 3 +-- tools/modinfo.c | 3 +-- tools/modprobe.c | 3 +-- tools/rmmod.c | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/depmod.c b/tools/depmod.c index 5d94c17..2107770 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 bc7115f..c05a6fc 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 c6a12ae..f770ec9 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 4cd6645..0dea878 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 9d09515..689675b 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" -- 2.7.4