]> git.pond.sub.org Git - empserver/blob - info/Syntax.t
fairland: Tidy up comments
[empserver] / info / Syntax.t
1 .TH Concept "Command Syntax"
2 .NA Syntax "The Empire command syntax"
3 .LV Basic
4 .de AB
5 .in 0.3i
6 .ti -0.3i
7 ..
8 .s1
9 The Empire Shell (command interpreter)
10 expects input in the form:
11 .EX VERB ARG1 ARG2 ...
12 VERB is any one of the Empire commands on the \*Qcommand list\*U
13 (what you see when you type \*Qlist\*U-- e.g.
14 \*Qmap\*U, \*Qmove\*U, \*Qinfo\*U, etc).
15 .s1
16 The number of ARGs varies from command to command.
17 In most cases the ARGs need not be supplied on the command line;
18 any that are not supplied will be obtained by prompting.
19 The exception to this rule are those ARGs
20 that are enclosed in [square brackets]
21 in the command list.
22 The presence of these ARGs changes the way the command is carried out.
23 .s1
24 Certain basic argument types recur often and are abbreviated in the
25 following ways.
26 .s1
27 .AB
28 <TYPE> ::= 'se', 'sh', 'l', or 'p' for sector, ship, land unit, or
29 plane respectively.  If "sector" is not a possibility, then 's' will
30 likely suffice for "ship".
31 .s1
32 .AB
33 <CNUM/CNAME> ::= either a country number or a country name
34 .s1
35 .AB
36 <COMM> ::= any one, (or unambiguous abbreviation), of the list of
37 commodities found in \*Qinfo Selector\*U:
38 .s1
39 .AB
40 <LOAN> ::= loan number
41 .s1
42 .AB
43 <SECT> ::= sector coordinates in the form: x,y
44 .s1
45 .AB
46 .ne 4
47 <SECTS> ::= sector(s) in the form:
48 .NF
49 lox:hix,loy:hiy ?cond&cond&...
50 .FI
51 \*Qlox\*U, \*Qhix\*U, \*Qloy\*U, \*Qhiy\*U are coordinates bounding
52 the rectangular area to be considered
53 .s1
54 \*Qcond\*U is a condition of the form:
55 .NF
56 <VALUE><OPERATOR><VALUE>
57 .FI
58 <VALUE> is either a <COMM>, as above,
59 a number in the range 0 to 65536,
60 a sector designation,
61 (\*Qm\*U for mine, \*Qc\*U for capital, etc), a type of unit
62 (\*Qfrigate\*U, \*Qcavalry\*U, etc), or a selector found in \*Qinfo
63 Selector\*U.
64 .br
65 <OPERATOR> can be any one of:
66 .in +\w'#\0\0'u
67 .L <
68 less than
69 .L =
70 equal
71 .L >
72 greater than
73 .L #
74 not equal
75 .in
76 .s1
77 Thus \*Qmob=100\*U, \*Qore#0\*U, \*Q7=guns\*U, \*Qciv#mil\*U,
78 \*Qdes=b\*U are examples of legitimate conditions,
79 (note lack of embedded spaces),
80 and
81 .EX census -3:3,-3:3 ?des=+&gun=5&mil>civ
82 will list all highways
83 within 3 of your capital
84 with exactly 5 guns and more military than civilians.
85 .sp
86 Similarly,
87 .EX deliver f -9:9,-9:9 ?f_del=0
88 will allow you to set up food delivery
89 in all the sectors that don't already
90 have food delivery.
91 .sp
92 Note that \*Qhix\*U, \*Qhiy\*U, and \*Q?cond\*U are all optional.
93 Also, the entire \*Qlox:hix,loy:hiy\*U section may be replaced
94 by either \*Q#\*U, \*Q#0\*U, \*Q#1\*U, \*Q#2\*U,
95 or \*Q#3\*U, ... which refer to
96 \*Qrealm\*Us which you can define.
97 (See \*Qinfo realm\*U.)
98 Note that \*Q#\*U and \*Q#0\*U are equivalent.  Also \*Q*\*U refers to
99 all sectors, and \*Q@x,y:dist\*U refers to all sectors within dist of x,y.
100 .s1
101 .AB
102 <SHIP> ::= one ship number
103 .s1
104 .AB
105 <FLEET> ::= fleet designation,
106 which may be a list of ships separated by slashes (`/'),
107 a fleet letter,
108 the character tilde (`~') which means all ships not in a specific fleet,
109 or a rectangular sector area.
110 .s1
111 .AB
112 <SHIP/FLEET> ::= either a single ship number or a fleet designation.
113 .sp
114 Note that <FLEET> specifications may have an optional ?cond&cond...
115 argument like that used for <SECTS> arguments.
116 For instance:
117 .EX ship ~ ?des=d&mil>5
118 will list all destroyers that have more than 5 military
119 which are not currently in any fleet.
120 .in 0
121 .s1
122 The output from commands may also be sent to a file or another
123 process by utilizing these alternate syntaxes:
124 .s1
125 .ne 2
126 .EX VERB ARG1 ... > FILE
127 which sends the output to the file \*QFILE\*U.
128 .s1
129 .ne 2
130 .EX VERB ARG1 ... >> FILE
131 which appends the output to the file \*QFILE\*U.
132 .s1
133 .ne 2
134 .EX VERB ARG1 ... >! FILE
135 which sends the output to the file \*QFILE\*U,
136 replacing the file it if it already exists.
137 .s1
138 .ne 2
139 .EX VERB ARG ... | PROGRAM [ARGS...]
140 which send the output of the command to the program \*QPROGRAM\*U
141 with optional arguments \*QARGS\*U.
142 This is most useful when \*QPROGRAM\*U is some type of
143 pager like \*(iFmore\*(pF(1) or \*(iFless\*(pF(1).
144 .s1
145 The Empire shell also recognizes a few control characters:
146 .s1
147 .in +\w'interrupt\0\0'u
148 .L \*(fIname\*(fP
149 \*(fImeaning\*(fP
150 .L interrupt
151 Abort command and return to Empire command level
152 .L quit
153 Exit Empire
154 .L EOT
155 Exit Empire
156 .in
157 .s1
158 .SA "realm, Moving, Selector, Playing"