1 02/21/84  answer
 2 
 3 Syntax:  answer STR {-control_args} command_line
 4 
 5 
 6 Function:  provides preset answers to questions asked by another
 7 command.
 8 
 9 
10 Arguments:
11 STR
12    is the desired answer to any question.  If the answer is more than
13    one word, it must be enclosed in quotes.  If STR is -query, the
14    question is passed on to you.  The -query control argument is
15    the only one that can be used in place of STR.
16 command_line
17    is any Multics command line.  It can contain any number of separate
18    arguments (i.e., have spaces within it) and need not be enclosed in
19    quotes.
20 
21 
22 Control arguments:
23 -brief, -bf
24    suppresses printing (on your terminal) of both the question
25    and the answer.
26 -call STR
27    evaluates the active function string STR to obtain the next answer
28    in a sequence.  STR must be quoted if it contains command language
29    characters.  The surrounding brackets must be omitted, as in "segs
30    *.pl1".  The return value "true" is translated to "yes", and "false"
31    to "no".  All other return values are passed as is.
32 
33 
34 -match STR
35    answers only questions whose text matches STR.  If STR is surrounded
36    by slashes (/), it is interpreted as a qedx regular expression.
37    Otherwise, answer tests whether STR is literally contained in the
38    text of the question.  Multiple occurrences of -match and -exclude
39    are allowed (see Notes below).  They apply to the entire command
40    line.
41 -exclude STR, -ex STR
42    passes on, to you or other handler, questions whose text
43    matches STR.  If STR is surrounded by slashes (/), it is interpreted
44    as a qedx regular expression.  Otherwise, answer tests whether STR
45    is literally contained in the text of the question.  Multiple
46    occurrences of -match and -exclude are allowed (see Notes below).
47    They apply to the entire command line.
48 
49 
50 -query
51    skips the next answer in a sequence, passing on the question to you.
52    The answer is read from the user_io I/O switch.
53 -then STR
54    supplies the next answer in a sequence.
55 -times N
56    gives the previous answer (STR, -then STR, or -query) N times only,
57    where N is an integer.
58 
59 
60 Notes:  Answer provides preset responses to questions by establishing
61 an on unit for the condition command_question and then by executing the
62 designated command.  If the specified  command calls the command_query_
63 subroutine (see the Subroutines manual) to ask a question, the on
64 unit is invoked to supply the answer.  The on unit is reverted when the
65 answer command returns to command level.  See "List of System
66 Conditions and Default Handlers" in the Programmer's Reference Manual
67 for a discussion of the command_question condition.
68 
69 If a question is asked that requires a yes or no answer, and the preset
70 answer is neither "yes" nor "no", the on unit is not invoked.
71 
72 The last answer specified is issued as many times as necessary, unless
73 followed by -times.
74 
75 
76 The -match and -exclude control arguments are applied in the order
77 specified.  Each -match causes a given question to be answered if it
78 matches STR; each -exclude causes it to be passed on if it matches STR.
79 A question that has been excluded by -exclude is reconsidered if it
80 matches a -match later in the command line.  For example, the command
81 line
82 
83 answer yes -match /fortran/ -exclude /fortran_io/ -match /^fortran_io/
84 
85 answers questions containing the string "fortran" or beginning with
86 "fortran_io", but does not answer questions containing "fortran_io".