tomwalters@0: .TH OPTIONS 1 "1 September 1993" tomwalters@0: tomwalters@0: .SH NAME tomwalters@0: options \- a general description of the AIM tools options handler. tomwalters@0: tomwalters@0: .SH SYNTAX tomwalters@0: tomwalters@0: .nf tomwalters@0: command line ::= [] [] tomwalters@0: tomwalters@0: option ::= | tomwalters@0: tomwalters@0: flag option ::= - | [-]=on|off tomwalters@0: tomwalters@0: valued option ::= -[=] | [-]= tomwalters@0: .fi tomwalters@0: tomwalters@0: .SH DESCRIPTION tomwalters@0: tomwalters@0: A program may take one or more files as input, and several options to set tomwalters@0: internal parameters. The function of the options handler is to parse the tomwalters@0: command line and interpret options according to the defined syntax, tomwalters@0: to assign internal default values to the internal parameters represented by tomwalters@0: each option, and then to override these using any corresponding options tomwalters@0: found on the command line. tomwalters@0: tomwalters@0: tomwalters@0: .SH "Command line syntax" tomwalters@0: tomwalters@0: Programs which do not read input from files have a command line: tomwalters@0: tomwalters@0: .nf tomwalters@0: [] tomwalters@0: .fi tomwalters@0: tomwalters@0: Programs which expect to read input from one or more files have command line syntax: tomwalters@0: tomwalters@0: .nf tomwalters@0: [] [] tomwalters@0: .fi tomwalters@0: tomwalters@0: The command line parser assumes that each space-separated token on the command tomwalters@0: line is either an option or a filename. tomwalters@0: The strategy is to parse the command tomwalters@0: line until either it is empty or a token with invalid option syntax is found. tomwalters@0: All tokens remaining on the command line after parsing are assumed tomwalters@0: to be input filenames. tomwalters@0: Programs which read from one or more files expect the filenames to be given as tomwalters@0: the final arguments on the command line. tomwalters@0: If the command line is empty after parsing the options, but a file is expected, tomwalters@0: then input is read from the standard input, (eg. via re-direction or a pipe). tomwalters@0: The filename `-' is also interpreted as the standard input. tomwalters@0: tomwalters@0: Typographical errors which cause options to have bad syntax are therefore treated as tomwalters@0: potential filenames. tomwalters@0: The program reports the error as if it were a file not found, by printing a message tomwalters@0: on the stderr: tomwalters@0: tomwalters@0: .nf tomwalters@0: : can't open