From: Christos Zoulas Date: Thu, 3 Feb 2011 01:54:43 +0000 (+0000) Subject: help and version output to stdout X-Git-Tag: FILE5_07~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa1cec9b2306e98a3cd6c2ff82bb47aae04cd6fd;p=file help and version output to stdout --- diff --git a/ChangeLog b/ChangeLog index 42166050..a35a2608 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-02-02 20:40 Christos Zoulas + * help and version output to stdout. + * When matching softmagic for ascii files, don't just print the softmagic classification, keep going and print the text classification too. This fixes broken troff files when diff --git a/src/file.c b/src/file.c index 85d26c15..3518b0ae 100644 --- a/src/file.c +++ b/src/file.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: file.c,v 1.139 2010/10/08 22:03:57 christos Exp $") +FILE_RCSID("@(#)$File: file.c,v 1.140 2010/11/30 14:58:53 rrt Exp $") #endif /* lint */ #include "magic.h" @@ -255,9 +255,9 @@ main(int argc, char *argv[]) case 'v': if (magicfile == NULL) magicfile = magic_getpath(magicfile, action); - (void)fprintf(stderr, "%s-%d.%.2d\n", progname, + (void)fprintf(stdout, "%s-%d.%.2d\n", progname, FILE_VERSION_MAJOR, patchlevel); - (void)fprintf(stderr, "magic file from %s\n", + (void)fprintf(stdout, "magic file from %s\n", magicfile); return 1; case 'z': @@ -486,11 +486,11 @@ help(void) (void)fputs( "Usage: file [OPTION...] [FILE...]\n" "Determine type of FILEs.\n" -"\n", stderr); +"\n", stdout); #define OPT(shortname, longname, opt, doc) \ - fprintf(stderr, " -%c, --" longname doc, shortname); + fprintf(stdout, " -%c, --" longname doc, shortname); #define OPT_LONGONLY(longname, opt, doc) \ - fprintf(stderr, " --" longname doc); + fprintf(stdout, " --" longname doc); #include "file_opts.h" #undef OPT #undef OPT_LONGONLY