Next: fid invocation, Previous: mkid invocation, Up: Top
lid: Querying an ID Database by TokenThe lid program accepts patterns on the command line which it matches against the tokens stored in an ID database. The interpretation of a pattern is determined by the makeup of the pattern string itself, or can be overridden by command-line options. If a pattern contains regular expression meta-characters, it is used to perform a regular-expression substring search. If no such meta-characters are present, pattern is used to perform a literal word search. (By default, all searches are sensitive to alphabetic case.) If no pattern is supplied on the command line, lid lists every entry in the ID database.
lid reads the ID database, therefore it accepts the `--file' option, and consults the `IDPATH' environment variable, as described in Reading options. lid lists file names, therefore it accepts the `--separator' option, as described in File listing options.
In addition, lid accepts the following command-line options:
$ lid --key=token '^dest.'
destaddr libsys/memcpy.c
destination libsys/regex.c
destlst libsys/rx.c
destpos libsys/rx.c
destset libsys/rx.h libsys/rx.c
$ lid --key=pattern '^dest.'
^dest. libsys/rx.h libsys/{memcpy,regex,rx}.c
$ lid --key=none '^dest.'
libsys/rx.h libsys/{memcpy,regex,rx}.c
When `--key' is either `token' or `pattern', the first
column of output is a token or pattern, respectively. When
`--key' is `none', neither of these is printed, and the file
name list begins immediately. The default is `token'.
..m. Either limit of the range may be omitted (e.g.,
..m, or n....). If the lower limit n is
omitted, it defaults to 1. If the upper limit is omitted, it
defaults in the present implementation to 65535, the maximum
value of an unsigned 16-bit integer.
Particularly useful queries are `lid -F1', which helps locate
identifiers that are defined but never used, or are used but never
defined. Similarly, lid -F2 can help find functions that possess
a prototype declaration and a definition, but are never called.