From: Karel Zak Date: Mon, 1 Mar 2010 09:51:12 +0000 (+0100) Subject: ldattach: prints help to stdout X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5b28b435ede727c24233aa4d0ba8507e8a169b9;p=util-linux ldattach: prints help to stdout Signed-off-by: Karel Zak --- diff --git a/sys-utils/ldattach.c b/sys-utils/ldattach.c index 26cf10a7..4fe5a7bb 100644 --- a/sys-utils/ldattach.c +++ b/sys-utils/ldattach.c @@ -145,13 +145,15 @@ static int parse_iflag(char *str, int *set_iflag, int *clr_iflag) static void __attribute__((__noreturn__)) usage(int exitcode) { - fprintf(stderr, + FILE *out = exitcode == EXIT_SUCCESS ? stdout : stderr; + + fprintf(out, _("\nUsage: %s [ -dhV78neo12 ] [ -s ] [ -i [-] ] \n"), progname); - fputs(_("\nKnown names:\n"), stderr); - print_table(stderr, ld_discs); - fputs(_("\nKnown names:\n"), stderr); - print_table(stderr, ld_iflags); + fputs(_("\nKnown names:\n"), out); + print_table(out, ld_discs); + fputs(_("\nKnown names:\n"), out); + print_table(out, ld_iflags); exit(exitcode); }