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 are the command-line options that
should be passed through to it. For example, to pass the -x
–coke-bottle options to the scanner for the language swizzle,
pass this: -l swizzle:"-x –coke-bottle", or this:
-lang-option=swizzle:"-x –coke-bottle", or this: -l
swizzle-x -l swizzle:–coke-bottle. Use the `--help' option to
see the command-line option summary for
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'.