xref: /freebsd/contrib/file/src/file_opts.h (revision 2726a7014867ad7224d09b66836c5d385f0350f4)
1b6cee71dSXin LI /*
2b6cee71dSXin LI  * Table of command-line options
3b6cee71dSXin LI  *
4b6cee71dSXin LI  * The first column specifies the short name, if any, or 0 if none.
5b6cee71dSXin LI  * The second column specifies the long name.
6b6cee71dSXin LI  * The third column specifies whether it takes a parameter.
7d38c30c0SXin LI  * The fourth colums specifies whether is is marked as "default"
8d38c30c0SXin LI  *      if POSIXLY_CORRECT is defined: 1,
9d38c30c0SXin LI  *      if POSIXLY_CORRECT is not defined: 2.
10d38c30c0SXin LI  * The fifth column is the documentation.
11b6cee71dSXin LI  *
12b6cee71dSXin LI  * N.B. The long options' order must correspond to the code in file.c,
13b6cee71dSXin LI  * and OPTSTRING must be kept up-to-date with the short options.
14b6cee71dSXin LI  * Pay particular attention to the numbers of long-only options in the
15b6cee71dSXin LI  * switch statement!
16b6cee71dSXin LI  */
17b6cee71dSXin LI 
18*2726a701SXin LI OPT_LONGONLY("help", 0, 0,
19*2726a701SXin LI     "                 display this help and exit\n", OPT_HELP)
20*2726a701SXin LI OPT('v', "version", 0, 0,
21*2726a701SXin LI     "              output version information and exit\n")
22*2726a701SXin LI OPT('m', "magic-file", 1, 0,
23*2726a701SXin LI     " LIST      use LIST as a colon-separated list of magic\n"
24b6cee71dSXin LI     "                               number files\n")
25*2726a701SXin LI OPT('z', "uncompress", 0, 0,
26*2726a701SXin LI     "           try to look inside compressed files\n")
27*2726a701SXin LI OPT('Z', "uncompress-noreport", 0, 0,
28*2726a701SXin LI     "  only print the contents of compressed files\n")
29*2726a701SXin LI OPT('b', "brief", 0, 0,
30*2726a701SXin LI     "                do not prepend filenames to output lines\n")
31*2726a701SXin LI OPT('c', "checking-printout", 0, 0,
32*2726a701SXin LI     "    print the parsed form of the magic file, use in\n"
33b6cee71dSXin LI     "                               conjunction with -m to debug a new magic file\n"
34b6cee71dSXin LI     "                               before installing it\n")
35*2726a701SXin LI OPT('e', "exclude", 1, 0,
36*2726a701SXin LI     " TEST         exclude TEST from the list of test to be\n"
37b6cee71dSXin LI     "                               performed for file. Valid tests are:\n"
38*2726a701SXin LI     "                               %e\n")
39*2726a701SXin LI OPT_LONGONLY("exclude-quiet", 1, 0,
40*2726a701SXin LI     " TEST         like exclude, but ignore unknown tests\n", OPT_EXCLUDE_QUIET)
41*2726a701SXin LI OPT('f', "files-from", 1, 0,
42*2726a701SXin LI     " FILE      read the filenames to be examined from FILE\n")
43*2726a701SXin LI OPT('F', "separator", 1, 0,
44*2726a701SXin LI     " STRING     use string as separator instead of `:'\n")
45*2726a701SXin LI OPT('i', "mime", 0, 0,
46*2726a701SXin LI     "                 output MIME type strings (--mime-type and\n"
47b6cee71dSXin LI     "                               --mime-encoding)\n")
48*2726a701SXin LI OPT_LONGONLY("apple", 0, 0,
49*2726a701SXin LI     "                output the Apple CREATOR/TYPE\n", OPT_APPLE)
50*2726a701SXin LI OPT_LONGONLY("extension", 0, 0,
51*2726a701SXin LI     "            output a slash-separated list of extensions\n", OPT_EXTENSIONS)
52*2726a701SXin LI OPT_LONGONLY("mime-type", 0, 0,
53*2726a701SXin LI     "            output the MIME type\n", OPT_MIME_TYPE)
54*2726a701SXin LI OPT_LONGONLY("mime-encoding", 0, 0,
55*2726a701SXin LI     "        output the MIME encoding\n", OPT_MIME_ENCODING)
56*2726a701SXin LI OPT('k', "keep-going", 0, 0,
57*2726a701SXin LI     "           don't stop at the first match\n")
58*2726a701SXin LI OPT('l', "list", 0, 0,
59*2726a701SXin LI     "                 list magic strength\n")
60b6cee71dSXin LI #ifdef S_IFLNK
61*2726a701SXin LI OPT('L', "dereference", 0, 1,
62*2726a701SXin LI     "          follow symlinks")
63*2726a701SXin LI OPT('h', "no-dereference", 0, 2,
64*2726a701SXin LI     "       don't follow symlinks")
65b6cee71dSXin LI #endif
66*2726a701SXin LI OPT('n', "no-buffer", 0, 0,
67*2726a701SXin LI     "            do not buffer output\n")
68*2726a701SXin LI OPT('N', "no-pad", 0, 0,
69*2726a701SXin LI     "               do not pad output\n")
70*2726a701SXin LI OPT('0', "print0", 0, 0,
71*2726a701SXin LI     "               terminate filenames with ASCII NUL\n")
72b6cee71dSXin LI #if defined(HAVE_UTIME) || defined(HAVE_UTIMES)
73*2726a701SXin LI OPT('p', "preserve-date", 0, 0,
74*2726a701SXin LI     "        preserve access times on files\n")
75b6cee71dSXin LI #endif
76*2726a701SXin LI OPT('P', "parameter", 1, 0,
77*2726a701SXin LI     "            set file engine parameter limits\n"
78*2726a701SXin LI     "                               %P\n")
79*2726a701SXin LI OPT('r', "raw", 0, 0,
80*2726a701SXin LI     "                  don't translate unprintable chars to \\ooo\n")
81*2726a701SXin LI OPT('s', "special-files", 0, 0,
82*2726a701SXin LI     "        treat special (block/char devices) files as\n"
83b6cee71dSXin LI     "                             ordinary ones\n")
84*2726a701SXin LI OPT('S', "no-sandbox", 0, 0,
85*2726a701SXin LI     "           disable system call sandboxing\n")
86*2726a701SXin LI OPT('C', "compile", 0, 0,
87*2726a701SXin LI     "              compile file specified by -m\n")
88*2726a701SXin LI OPT('d', "debug", 0, 0,
89*2726a701SXin LI     "                print debugging messages\n")
90