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