xref: /freebsd/contrib/file/src/file_opts.h (revision 898496ee09ed2b7d25f6807edc4515628196ec0a)
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.
7a2dfb722SXin LI  * The fourth column specifies whether 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 
182726a701SXin LI OPT_LONGONLY("help", 0, 0,
192726a701SXin LI     "                 display this help and exit\n", OPT_HELP)
202726a701SXin LI OPT('v', "version", 0, 0,
212726a701SXin LI     "              output version information and exit\n")
222726a701SXin LI OPT('m', "magic-file", 1, 0,
232726a701SXin LI     " LIST      use LIST as a colon-separated list of magic\n"
24b6cee71dSXin LI     "                               number files\n")
252726a701SXin LI OPT('z', "uncompress", 0, 0,
262726a701SXin LI     "           try to look inside compressed files\n")
272726a701SXin LI OPT('Z', "uncompress-noreport", 0, 0,
282726a701SXin LI     "  only print the contents of compressed files\n")
292726a701SXin LI OPT('b', "brief", 0, 0,
302726a701SXin LI     "                do not prepend filenames to output lines\n")
312726a701SXin LI OPT('c', "checking-printout", 0, 0,
322726a701SXin 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")
352726a701SXin LI OPT('e', "exclude", 1, 0,
362726a701SXin LI     " TEST         exclude TEST from the list of test to be\n"
37b6cee71dSXin LI     "                               performed for file. Valid tests are:\n"
382726a701SXin LI     "                               %e\n")
392726a701SXin LI OPT_LONGONLY("exclude-quiet", 1, 0,
402726a701SXin LI     " TEST   like exclude, but ignore unknown tests\n", OPT_EXCLUDE_QUIET)
412726a701SXin LI OPT('f', "files-from", 1, 0,
422726a701SXin LI     " FILE      read the filenames to be examined from FILE\n")
432726a701SXin LI OPT('F', "separator", 1, 0,
442726a701SXin LI     " STRING     use string as separator instead of `:'\n")
452726a701SXin LI OPT('i', "mime", 0, 0,
462726a701SXin LI     "                 output MIME type strings (--mime-type and\n"
47b6cee71dSXin LI     "                               --mime-encoding)\n")
482726a701SXin LI OPT_LONGONLY("apple", 0, 0,
492726a701SXin LI     "                output the Apple CREATOR/TYPE\n", OPT_APPLE)
502726a701SXin LI OPT_LONGONLY("extension", 0, 0,
512726a701SXin LI     "            output a slash-separated list of extensions\n", OPT_EXTENSIONS)
522726a701SXin LI OPT_LONGONLY("mime-type", 0, 0,
532726a701SXin LI     "            output the MIME type\n", OPT_MIME_TYPE)
542726a701SXin LI OPT_LONGONLY("mime-encoding", 0, 0,
552726a701SXin LI     "        output the MIME encoding\n", OPT_MIME_ENCODING)
562726a701SXin LI OPT('k', "keep-going", 0, 0,
572726a701SXin LI     "           don't stop at the first match\n")
582726a701SXin LI OPT('l', "list", 0, 0,
592726a701SXin LI     "                 list magic strength\n")
60b6cee71dSXin LI #ifdef S_IFLNK
612726a701SXin LI OPT('L', "dereference", 0, 1,
62*898496eeSXin LI     "          follow symlinks (default if POSIXLY_CORRECT is set)")
632726a701SXin LI OPT('h', "no-dereference", 0, 2,
64*898496eeSXin LI     "       don't follow symlinks (default if POSIXLY_CORRECT is not set)")
65b6cee71dSXin LI #endif
662726a701SXin LI OPT('n', "no-buffer", 0, 0,
672726a701SXin LI     "            do not buffer output\n")
682726a701SXin LI OPT('N', "no-pad", 0, 0,
692726a701SXin LI     "               do not pad output\n")
702726a701SXin LI OPT('0', "print0", 0, 0,
712726a701SXin LI     "               terminate filenames with ASCII NUL\n")
72b6cee71dSXin LI #if defined(HAVE_UTIME) || defined(HAVE_UTIMES)
732726a701SXin LI OPT('p', "preserve-date", 0, 0,
742726a701SXin LI     "        preserve access times on files\n")
75b6cee71dSXin LI #endif
762726a701SXin LI OPT('P', "parameter", 1, 0,
772726a701SXin LI     "            set file engine parameter limits\n"
782726a701SXin LI     "                               %P\n")
792726a701SXin LI OPT('r', "raw", 0, 0,
802726a701SXin LI     "                  don't translate unprintable chars to \\ooo\n")
812726a701SXin LI OPT('s', "special-files", 0, 0,
822726a701SXin LI     "        treat special (block/char devices) files as\n"
83b6cee71dSXin LI     "                             ordinary ones\n")
842726a701SXin LI OPT('S', "no-sandbox", 0, 0,
852726a701SXin LI     "           disable system call sandboxing\n")
862726a701SXin LI OPT('C', "compile", 0, 0,
872726a701SXin LI     "              compile file specified by -m\n")
882726a701SXin LI OPT('d', "debug", 0, 0,
892726a701SXin LI     "                print debugging messages\n")
90