]> git.pond.sub.org Git - empserver/blob - info/Concepts/Syntax.t
Import of Empire 4.2.12
[empserver] / info / Concepts / 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 \Q*command 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 .AB
39 <LOAN> ::= loan number
40 .AB
41 <SECT> ::= sector coordinates in the form: x,y
42 .AB
43 .ne 4
44 <SECTS> ::= sector(s) in the form:
45 .NF +0i
46 lox:hix,loy:hiy ?cond&cond&...
47 .FI
48 \*Qlox\*U, \*Qhix\*U, \*Qloy\*U, \*Qhiy\*U are coordinates bounding
49 the rectangular area to be considered
50 .s1
51 \*Qcond\*U is a condition of the form:
52 .NF +0i
53 <VALUE><OPERATOR><VALUE>
54 .FI
55 <VALUE> is either a <COMM>, as above,
56 a number in the range 0 to 65536,
57 a sector designation,
58 (\*Qm\*U for mine, \*Qc\*U for capital, etc), a type of unit
59 (\*Qfrigate\*U, \*Qcavalry\*U, etc), or a selector found in \*Qinfo
60 Selector\*U.
61 .br
62 <OPERATOR> can be any one of:
63 .in +\w'#\0\0'u
64 .L <
65 less than
66 .L =
67 equal
68 .L >
69 greater than
70 .L #
71 not equal
72 .in
73 .s1
74 Thus \*Qmob=100\*U, \*Qore#0\*U, \*Q7=guns\*U, \*Qciv#mil\*U,
75 \*Qdes=b\*U are examples of legitimate conditions,
76 (note lack of embedded spaces),
77 and
78 .EX census -3:3,-3:3 ?des=+&gun=5&mil>civ
79 will list all highways
80 within 3 of your capital
81 with exactly 5 guns and more military than civilians.
82 .sp
83 Similarly,
84 .EX deliver f -9:9,-9:9 ?f_del=0
85 will allow you to set up food delivery
86 in all the sectors that don't already
87 have food delivery.
88 .sp
89 Note that \*Qhix\*U, \*Qhiy\*U, and \*Q?cond\*U are all optional.
90 Also, the entire \*Qlox:hix,loy:hiy\*U section may be replaced
91 by either \*Q#\*U, \*Q#0\*U, \*Q#1\*U, \*Q#2\*U,
92 or \*Q#3\*U, ... which refer to 
93 \*Qrealm\*Us which you can define.
94 (See \*Qinfo realm\*U.)
95 Note that \*Q#\*U and \*Q#0\*U are equivalent.  Also \*Q*\*U refers to
96 all sectors, and \*Q@x,y:dist\*U refers to all sectors within dist of x,y.
97 .AB
98 <SHIP> ::= one ship number
99 .AB
100 <FLEET> ::= fleet designation,
101 which may be a list of ships separated by slashes (`/'),
102 a fleet letter,
103 the character tilde (`~') which means all ships not in a specific fleet,
104 or a rectangular sector area.
105 .AB
106 <SHIP/FLEET> ::= either a single ship number or a fleet designation.
107 .sp
108 Note that <FLEET> specifications may have an optional ?cond&cond...
109 argument like that used for <SECTS> arguments.
110 For instance:
111 .EX ship ~ ?des=d&mil>5
112 will list all destroyers that have more than 5 military
113 which are not currently in any fleet.
114 .s1
115 .in \\n(in
116 .s1
117 The output from commands may also be sent to a file or another
118 process by utilizing these alternate syntaxes:
119 .s1
120 .ne 2
121 .EX VERB ARG1 ... > FILE
122 which sends the output to the file \*QFILE\*U.
123 .s1
124 .ne 2
125 .EX VERB ARG1 ... >> FILE
126 which appends the output to the file \*QFILE\*U.
127 .s1
128 .ne 2
129 .EX VERB ARG1 ... >! FILE
130 which sends the output to the file \*QFILE\*U,
131 replacing the file it if it already exists.
132 .s1
133 .ne 2
134 .EX VERB ARG ... | PROGRAM [ARGS...]
135 which send the output of the command to the program \*QPROGRAM\*U
136 with optional arguments \*QARGS\*U.
137 This is most useful when \*QPROGRAM\*U is some type of
138 pager like \*(iFmore\*(pF(1) or \*(iFless\*(pF(1).
139 .s1
140 The Empire shell also recognizes a few control characters:
141 .s1
142 .in +\w'interrupt\0\0'u
143 .L \f2name\fP
144 \f2meaning\fP
145 .L interrupt
146 Abort command and return to Empire command level
147 .L quit
148 Exit Empire
149 .L EOT
150 Exit Empire
151 .in
152 .s1
153 .SA "realm, Move, Selector, Playing"