autom4te.cache
+Makefile
+config.h
+config.log
+config.status
+libtool
+stamp-h1
+2007-10-23 5:25 Christos Zoulas <christos@zoulas.com>
+
+ * Add --with-filename, and --no-filename (Reuben Thomas)
+
2007-10-23 3:59 Christos Zoulas <christos@zoulas.com>
* Rest of the mime split (Reuben Thomas)
--- /dev/null
+Makefile\r
+*.1\r
+*.3\r
+*.4\r
--- /dev/null
+Makefile\r
+magic\r
+*.mgc\r
--- /dev/null
+Makefile\r
--- /dev/null
+.deps\r
+Makefile
+config.h
+config.log
+config.status
+libtool
+stamp-h1
+.libs\r
+*.lo\r
+*.la\r
+Makefile\r
+file\r
case 0:
help();
break;
- case 10:
+ case 5:
+ bflag++;
+ break;
+ case 6:
+ bflag = 0;
+ break;
+ case 12:
flags |= MAGIC_MIME_TYPE;
break;
- case 11:
+ case 13:
flags |= MAGIC_MIME_ENCODING;
break;
}
+ break;
#endif
case '0':
nulsep = 1;
break;
case 'b':
- ++bflag;
+ bflag++;
break;
case 'c':
action = FILE_CHECK;
flags |= MAGIC_DEVICES;
break;
case 'v':
- (void)fprintf(stdout, "%s-%d.%.2d\n", progname,
+ (void)fprintf(stderr, "%s-%d.%.2d\n", progname,
FILE_VERSION_MAJOR, patchlevel);
- (void)fprintf(stdout, "magic file from %s\n",
+ (void)fprintf(stderr, "magic file from %s\n",
magicfile);
return 1;
case 'z':
if (nw > wid)
wid = nw;
}
+ /*
+ * If bflag is only set once, set it depending on
+ * number of files
+ */
+ if (bflag == 1) {
+ bflag = optind >= argc - 1;
+ }
for (; optind < argc; optind++)
process(argv[optind], wid);
}
private void
help(void)
{
- (void)puts(
+ (void)fputs(
"Usage: file [OPTION...] [FILE...]\n"
-"Determine file type of FILEs.\n");
+"Determine type of FILEs.\n"
+"\n", stderr);
#define OPT(shortname, longname, opt, doc) \
- printf(" -%c, --" longname doc, shortname);
+ fprintf(stderr, " -%c, --" longname doc, shortname);
#define OPT_LONGONLY(longname, opt, doc) \
- printf(" --" longname doc);
+ fprintf(stderr, " --" longname doc);
#include "file_opts.h"
#undef OPT
#undef OPT_LONGONLY
-/* $File$ */
-
/*
* Table of command-line options
*
*
* N.B. The long options' order must correspond to the code in file.c,
* and OPTSTRING must be kept up-to-date with the short options.
+ * Pay particular attention to the numbers of long-only options in the
+ * switch statement!
*/
OPT_LONGONLY("help", 0, " display this help and exit\n")
OPT('m', "magic-file", 1, " LIST use LIST as a colon-separated list of magic\n"
" number files\n")
OPT('z', "uncompress", 0, " try to look inside compressed files\n")
-OPT('b', "brief", 0, " do not prepend filenames to output lines\n")
+OPT('b', "brief", 0, " do not prepend filenames to output lines\n"
+ " If this flag is specified once, then\n"
+ " the filename is printed if more than one\n"
+ " files are tested. If this flag is specified\n"
+ " more than once, then filenames are never printed\n")
+OPT_LONGONLY("no-filename", 0, " synonym for --brief\n")
+OPT_LONGONLY("with-filename", 0, " print the file name for each match. This is\n"
+ " the default.\n")
OPT('c', "checking-printout", 0, " print the parsed form of the magic file, use in\n"
" conjunction with -m to debug a new magic file\n"
" before installing it\n")