summaryrefslogtreecommitdiffstats
path: root/iid.1
diff options
context:
space:
mode:
Diffstat (limited to 'iid.1')
-rw-r--r--iid.1235
1 files changed, 235 insertions, 0 deletions
diff --git a/iid.1 b/iid.1
new file mode 100644
index 0000000..0cc256f
--- /dev/null
+++ b/iid.1
@@ -0,0 +1,235 @@
+.TH IID 1
+.SH NAME
+iid \- interactive query for ID database
+.SH SYNOPSIS
+.PP
+.B iid
+.RB [ \-a]
+.RB [ \-c \^command]
+.RB [ \-H]
+.SH DESCRIPTION
+This command provides an interactive query interface to the
+.I ID
+database.
+.I Iid\^
+allows you to query an
+.I ID
+database in a fashion similar to using \fIDIALOG\fP. Any individual
+query command results in a list of files that satisfy that query,
+each set of files is retained by
+.I iid
+and assigned a set number. The sets may be combined with
+.IR AND ,
+.I OR
+and
+.I NOT
+operators to produce additional sets. The primitive operators that
+produce sets are invocations of the
+.I lid
+or
+.I aid
+programs.
+.SH OPTIONS
+Normally
+.I iid
+runs interactively. Options may be used to run it in batch mode.
+.TP 8
+.B \-a
+Use the
+.I aid
+program as the default query program, normally
+.I lid
+is used.
+.TP 8
+.B \-c
+Accept a single command as an argument, run that command, and exit
+.IR Iid .
+.TP
+.B \-H
+Print a brief help message and exit.
+.SH SUBCOMMANDS
+The subcommands are used to carry on a dialog with
+.I iid
+after invoking the program.
+.PP
+Two basic query commands are available:
+.B SS
+and
+.BR FILES .
+The
+.B SS
+command shows the sets generated by a query, but does not display
+the actual file names that satisfy the query.
+The
+.B FILES
+command only displays the list of files, it does not show any
+of the sets created during the query.
+.PP
+Queries consist of keywords and identifier strings. The keywords are:
+.B and or not lid aid match
+and
+.B s<number>
+where
+.B s<number>
+is a set number consisting of the letter
+.B s
+followed (with no space) by a decimal set number.
+A clause of the form
+.B lid <identifier list>
+invokes
+.I lid
+with the
+.B <identifier list>
+as arguments and produces a set of files as a result.
+Substituting
+.B aid
+for
+.B lid
+runs the
+.I aid
+program to generate the list of files.
+As a shorthand notation for
+.B lid <identifier>
+you may simply use
+.B <identifier>.
+The
+.B match
+operator runs the standard system
+.I ls
+utility to produce a set of files. This allows sets to be
+constructed based on the names of files (using wild cards)
+rather than contents.
+The
+.B and or
+and
+.B not
+operators can be used to combine sets in the obvious fashion.
+If you need to pass any of the keywords as actual arguments to
+programs, or if the search strings contain any shell escape
+characters place the argument in quotes.
+.PP
+The
+.B NOT
+operator has highest precedence, followed by
+.B AND
+and
+.B OR
+in that order. Parenthesis may be used for grouping.
+.PP
+The remaining commands are:
+.PP
+.B BEGIN <directory>
+accepts a directory name and switches to that directory. By changing
+directories you control which
+.I ID
+database is searched. Changing directories automatically deletes
+all the sets constructed so far. The
+.B BEGIN
+command may be abbreviated as
+.BR B .
+.PP
+.B SETS
+shows the description of all the sets created so far. Each set
+description has the set number, the number of files in the set,
+and a symbolic description of the query that created the set.
+.PP
+.B SHOW <set number>
+runs a pager program, passing as arguments all the files in
+the specified set. The pager program comes from the
+.B $PAGER
+environment variable. This command may be abbreviated
+.BR P .
+.PP
+.B HELP
+runs the pager on the help file. The commands
+.B H
+and
+.B ?
+also act as help commands.
+.PP
+.B OFF
+exits the program.
+.B Q
+is short for
+.BR OFF .
+.PP
+All commands and keywords are case insensitive, so that
+.B SHOW ShOW
+and
+.B show
+all work equally well.
+.SH INTERFACE
+Two forms of commands are provided for interface with arbitrary
+programs. Any command that is not recognized as one
+of the above built in
+.I iid
+commands, is assumed to be a program which, when run, will print
+a list of file names.
+.I Iid
+runs the command as typed, and records the output as a new set
+which may be combined with other sets in subsequent queries.
+.PP
+If the command starts with a
+.BR !,
+.I iid
+strips off the leading
+.B !
+and simply runs the command. Any output goes to stdout and
+is not recorded as a set.
+.PP
+In both types of shell commands, any set numbers specified as
+arguments are expanded into a list of file names before running
+the command.
+.SH EXAMPLE
+.nf
+.ft L
+===> iid
+iid> ss lid "^get" or lid "Arg$"
+ S0 14 lid -kmn "^get"
+ S1 3 lid -kmn "Arg$"
+ S2 15 (lid -kmn "^get") OR (lid -kmn "Arg$")
+iid> f s1
+lid.c
+paths.c
+init.c
+iid> off
+.FT P
+.fi
+.EX off
+.PP
+In this example the
+.B ss
+command displays the sets it creates as it
+does the parts of the query. In this case 3 sets are created, set S0
+has 14 files in it, set S1 has 3 files and the union of the two sets,
+S2, has 15 files. A description of the query that created any given
+set is kept along with the set and displayed when sets are printed.
+.PP
+The
+.B f s1
+command lists the three files in set S1.
+.PP
+The
+.B off
+command terminates the example session.
+.SH HINTS
+The shell interface commands can be used to generate file sets by
+running the
+.I find
+or
+.I ls
+utilities, or compiles of a selected group of files can be done
+using the
+.BR ! cc
+command with a set number as the argument.
+.BR ! lp
+can be used to print a selected group of files.
+.PP
+This program interfaces nicely with
+.I emacs
+if you run the server program and specify the client program
+as your $PAGER.
+.SH SEE ALSO
+mkid(1),
+lid(1),
+aid(1).