Next: , Previous: Universal options, Up: Common options


3.6 Options for Programs that Scan Source Files

mkid and xtokid walk file trees, select source files by name, and extract tokens from source files. They accept the following options:

-m mapfile
--lang-map=mapfile
mapfile contains rules for determining the source languages from file names See Language map.
-i languages
--include=languages
The ‘--include’ option names languages whose source files should be scanned and incorporated into the ID database. By default, all languages known to the ID utilities are enabled.
-x languages
--exclude=languages
The ‘--exclude’ option names languages whose source files should not be scanned. The default list of excluded languages is empty. Note that only one of ‘--include’ or ‘--exclude’ may be specified on the command line for a single run.
-l language:options
--lang-option=language:options
Language-specific scanners also accept options. Language denotes the desired scanner, and option is the command-line option that should be passed through to it. For example, to pass the -x foo –coke-bottle options to the scanner for the language swizzle, use one of the next two forms, or a mixture of both:
          $ mkid -l swizzle:"-x foo" -l swizzle:--coke-bottle
          $ mkid --lang-option=swizzle:"-x foo" --lang-option=swizzle:--coke-bottle

Note the use of quotes when passing an option with arguments. Quoting is optional for options without arguments.

Use the ‘--help’ option to see the command-line option summary for each language.

To determine which tokens to extract from a file and store in the database, mkid calls a scanner; we say a scanner recognizes a particular language. Scanners for several languages are built-in to mkid; you can add your own scanners as well, as explained in Defining scanners.

The ID utilities determine which scanner to use for a particular file by consulting the language-map file. Scanners for several are already built-in to the ID utilities. You can see which languages have built-in scanners, and examine their language-specific options by invoking ‘mkid --help’ or ‘xtokid --help’.