]>
Commit | Line | Data |
---|---|---|
e329f98b JJ |
1 | // /**\r |
2 | //\r | |
3 | // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>\r | |
4 | // Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r | |
5 | // This program and the accompanying materials\r | |
6 | // are licensed and made available under the terms and conditions of the BSD License\r | |
7 | // which accompanies this distribution. The full text of the license may be found at\r | |
8 | // http://opensource.org/licenses/bsd-license.php\r | |
9 | //\r | |
10 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | //\r | |
13 | // Module Name:\r | |
14 | //\r | |
15 | // UefiShellLevel2CommandsLib.uni\r | |
16 | //\r | |
17 | // Abstract:\r | |
18 | //\r | |
19 | // String definitions for UEFI Shell 2.0 level 1 commands\r | |
20 | //\r | |
21 | //\r | |
22 | // **/\r | |
23 | \r | |
24 | /=#\r | |
25 | \r | |
26 | #langdef en-US "english"\r | |
27 | \r | |
28 | #string STR_NO_SCRIPT #language en-US "The command '%H%s%N' is incorrect outside of a script\r\n"\r | |
29 | #string STR_GEN_PROBLEM #language en-US "%H%s%N: Unknown flag - '%H%s%N'\r\n"\r | |
30 | #string STR_GEN_PROBLEM_VAL #language en-US "%H%s%N: Bad value - '%H%s%N' for flag - '%H%s%N'\r\n"\r | |
31 | #string STR_GEN_PROBLEM_SCRIPT #language en-US "The argument '%B%s%N' is incorrect. Line: %d\r\n"\r | |
32 | #string STR_GEN_INV_VAR #language en-US "The script's Indexvar '%B%s%N' is incorrect\r\n"\r | |
33 | #string STR_GEN_TOO_FEW #language en-US "%H%s%N: Too few arguments\r\n"\r | |
34 | #string STR_GEN_TOO_MANY #language en-US "%H%s%N: Too many arguments\r\n"\r | |
35 | #string STR_GEN_PARAM_INV #language en-US "%H%s%N: Invalid argument - '%H%s%N'\r\n"\r | |
36 | \r | |
37 | #string STR_TEXT_AFTER_THEN #language en-US "%H%s%N: Then cannot be followed by anything\r\n"\r | |
38 | #string STR_SYNTAX_AFTER_BAD #language en-US "%H%s%N: Syntax after '%H%s%N' is incorrect\r\n"\r | |
39 | #string STR_SYNTAX_IN #language en-US "Syntax after analyzing %s\r\n"\r | |
40 | #string STR_SYNTAX_NO_MATCHING #language en-US "No matching '%H%s%N' for '%H%s%N' statement found. Line: %d\r\n"\r | |
41 | #string STR_INVALID_BINOP #language en-US "Binary operator not found first in '%H%s%N'\r\n"\r | |
42 | #string STR_SYNTAX_STARTING #language en-US "Syntax after %s\r\n"\r | |
43 | \r | |
44 | #string STR_STALL_FAILED #language en-US "%H%s%N: BootService Stall() failed\r\n"\r | |
45 | \r | |
46 | #string STR_GET_HELP_EXIT #language en-US ""\r | |
47 | ".TH exit 0 "exits the script or shell"\r\n"\r | |
48 | ".SH NAME\r\n"\r | |
49 | "Exits the UEFI Shell or the current script.\r\n"\r | |
50 | ".SH SYNOPSIS\r\n"\r | |
51 | " \r\n"\r | |
52 | "EXIT [/b] [exit-code]\r\n"\r | |
53 | ".SH OPTIONS\r\n"\r | |
54 | " \r\n"\r | |
55 | " /b - Indicates that only the current UEFI shell script should be\r\n"\r | |
56 | " terminated. Ignored if not used within a script.\r\n"\r | |
57 | " exit-code - If exiting a UEFI shell script, the value that will be placed\r\n"\r | |
58 | " into the environment variable lasterror. If exiting an instance\r\n"\r | |
59 | " of the UEFI shell, the value that will be returned to the\r\n"\r | |
60 | " caller. If not specified, then 0 will be returned.\r\n"\r | |
61 | ".SH DESCRIPTION\r\n"\r | |
62 | " \r\n"\r | |
63 | "NOTES:\r\n"\r | |
64 | " 1. This command exits the UEFI Shell or, if /b is specified, the current\r\n"\r | |
65 | " script.\r\n"\r | |
66 | ".SH EXAMPLES\r\n"\r | |
67 | " \r\n"\r | |
68 | "EXAMPLES:\r\n"\r | |
69 | " * To exit shell successfully:\r\n"\r | |
70 | " Shell> exit\r\n"\r | |
71 | " \r\n"\r | |
72 | " * To exit the current UEFI shell script:\r\n"\r | |
73 | " Shell> exit /b \r\n"\r | |
74 | " \r\n"\r | |
75 | " * To exit a UEFI shell script with exit-code value returned to the caller:\r\n"\r | |
76 | " Shell> exit 0\r\n"\r | |
77 | ".SH RETURNVALUES\r\n"\r | |
78 | " \r\n"\r | |
79 | "RETURN VALUES:\r\n"\r | |
80 | " 0 Exited normally\r\n"\r | |
81 | " exit-code The return value specified as an option.\r\n"\r | |
82 | \r | |
83 | #string STR_GET_HELP_FOR #language en-US ""\r | |
84 | ".TH for 0 "starts a for loop"\r\n"\r | |
85 | ".SH NAME\r\n"\r | |
86 | "Starts a loop based on 'for' syntax.\r\n"\r | |
87 | ".SH SYNOPSIS\r\n"\r | |
88 | " \r\n"\r | |
89 | "FOR %indexvar IN set\r\n"\r | |
90 | " command [arguments]\r\n"\r | |
91 | " [command [arguments]]\r\n"\r | |
92 | " ...\r\n"\r | |
93 | "ENDFOR\r\n"\r | |
94 | " \r\n"\r | |
95 | "FOR %indexvar RUN (start end [step])\r\n"\r | |
96 | " command [arguments]\r\n"\r | |
97 | " [command [arguments]]\r\n"\r | |
98 | " ...\r\n"\r | |
99 | "ENDFOR\r\n"\r | |
100 | ".SH OPTIONS\r\n"\r | |
101 | " \r\n"\r | |
102 | " %indexvar - Variable name used to index a set\r\n"\r | |
103 | " set - Set to be searched\r\n"\r | |
104 | " command [arguments] - Command to be executed with optional arguments\r\n"\r | |
105 | ".SH DESCRIPTION\r\n"\r | |
106 | " \r\n"\r | |
107 | "NOTES:\r\n"\r | |
108 | " 1. The FOR command executes one or more commands for each item in a set of\r\n"\r | |
109 | " items. The set may be text strings or filenames or a mixture of both,\r\n"\r | |
110 | " separated by spaces (if not in a quotation).\r\n"\r | |
111 | " 2. If the length of an element in the set is between 0 and 256, and if the\r\n"\r | |
112 | " string contains wildcards, the string will be treated as a file name\r\n"\r | |
113 | " containing wildcards, and be expanded before command is executed.\r\n"\r | |
114 | " 3. If after expansion no such files are found, the literal string itself is\r\n"\r | |
115 | " kept. %indexvar is any alphabet character from 'a' to 'z' or 'A' to 'Z',\r\n"\r | |
116 | " and they are case sensitive. It should not be a digit (0-9) because\r\n"\r | |
117 | " %digit will be interpreted as a positional argument on the command line\r\n"\r | |
118 | " that launches the script. The namespace for index variables is separate\r\n"\r | |
119 | " from that for environment variables, so if %indexvar has the same name as\r\n"\r | |
120 | " an existing environment variable, the environment variable will remain\r\n"\r | |
121 | " unchanged by the FOR loop.\r\n"\r | |
122 | " 4. Each command is executed once for each item in the set, with any\r\n"\r | |
123 | " occurrence of %indexvar in the command replacing with the current item.\r\n"\r | |
124 | " In the second format of FOR ... ENDFOR statement, %indexvar will be\r\n"\r | |
125 | " assigned a value from start to end with an interval of step. Start and\r\n"\r | |
126 | " end can be any integer whose length is less than 7 digits excluding sign,\r\n"\r | |
127 | " and it can also applied to step with one exception of zero. Step is\r\n"\r | |
128 | " optional, if step is not specified it will be automatically determined by\r\n"\r | |
129 | " following rule:\r\n"\r | |
130 | " if start <= end then step = 1, otherwise step = -1.\r\n"\r | |
131 | " start, end and step are divided by space.\r\n"\r | |
132 | ".SH EXAMPLES\r\n"\r | |
133 | " \r\n"\r | |
134 | "EXAMPLES:\r\n"\r | |
135 | " * Sample FOR loop - listing all .txt files:\r\n"\r | |
136 | " echo -off\r\n"\r | |
137 | " for %a in *.txt\r\n"\r | |
138 | " echo %a exists\r\n"\r | |
139 | " endfor\r\n"\r | |
140 | " \r\n"\r | |
141 | " # \r\n"\r | |
142 | " # If in current directory, there are 2 files named file1.txt and file2.txt\r\n"\r | |
143 | " # then the output of the sample script will be as shown below.\r\n"\r | |
144 | " # \r\n"\r | |
145 | " Sample1> echo -off\r\n"\r | |
146 | " file1.txt exists\r\n"\r | |
147 | " file2.txt exists\r\n"\r | |
148 | " \r\n"\r | |
149 | " * Theoretically it is legal for 2 nested FOR commands to use the same\r\n"\r | |
150 | " alphabet letter as their index variable, for instance, a: \r\n"\r | |
151 | " #\r\n"\r | |
152 | " # Sample FOR loop from 1 to 3 with step 1\r\n"\r | |
153 | " #\r\n"\r | |
154 | " echo -off\r\n"\r | |
155 | " for %a run (1 3)\r\n"\r | |
156 | " echo %a\r\n"\r | |
157 | " endfor\r\n"\r | |
158 | " \r\n"\r | |
159 | " #\r\n"\r | |
160 | " # Sample FOR loop from 3 down to 1 with step -1\r\n"\r | |
161 | " #\r\n"\r | |
162 | " echo -off\r\n"\r | |
163 | " for %a run (3 1 -1)\r\n"\r | |
164 | " echo %a\r\n"\r | |
165 | " endfor\r\n"\r | |
166 | " \r\n"\r | |
167 | " #\r\n"\r | |
168 | " # Sample FOR loop - 2 nested for using same index variable\r\n"\r | |
169 | " #\r\n"\r | |
170 | " echo -off\r\n"\r | |
171 | " for %a in value1 value2\r\n"\r | |
172 | " for %a in value3 value4\r\n"\r | |
173 | " echo %a\r\n"\r | |
174 | " endfor\r\n"\r | |
175 | " endfor\r\n"\r | |
176 | " \r\n"\r | |
177 | " Note: When processing first FOR and before seeing the ENDFOR, the index\r\n"\r | |
178 | " variable %a has the value "value1", so in second FOR, the %a has\r\n"\r | |
179 | " been already defined and it will be replaced with the current value\r\n"\r | |
180 | " of %a. The string after substitution becomes FOR value1 in value3\r\n"\r | |
181 | " value4, which is not a legal FOR command. Thus only when the value\r\n"\r | |
182 | " of %a is also a single alphabet letter, the script will be executed\r\n"\r | |
183 | " without error. If 2 independent FOR commands use the same index\r\n"\r | |
184 | " variable, when the second FOR is encountered, the first FOR has\r\n"\r | |
185 | " already freed the variable so there will be no problem in this case.\r\n"\r | |
186 | \r | |
187 | #string STR_GET_HELP_ENDFOR #language en-US ""\r | |
188 | ".TH endfor 0 "ends a for loop"\r\n"\r | |
189 | ".SH NAME\r\n"\r | |
190 | "Ends a 'for' loop.\r\n"\r | |
191 | ".SH SYNOPSIS\r\n"\r | |
192 | "See 'for' for usage.\r\n"\r | |
193 | ".SH EXAMPLES\r\n"\r | |
194 | "See 'for' for examples.\r\n"\r | |
195 | \r | |
196 | #string STR_GET_HELP_GOTO #language en-US ""\r | |
197 | ".TH goto 0 "moves to a label"\r\n"\r | |
198 | ".SH NAME\r\n"\r | |
199 | "Moves around the point of execution in a script.\r\n"\r | |
200 | ".SH SYNOPSIS\r\n"\r | |
201 | " \r\n"\r | |
202 | "GOTO label\r\n"\r | |
203 | ".SH OPTIONS\r\n"\r | |
204 | " \r\n"\r | |
205 | " label - Specifies a location in batch file\r\n"\r | |
206 | ".SH DESCRIPTION\r\n"\r | |
207 | " \r\n"\r | |
208 | "NOTES:\r\n"\r | |
209 | " 1. The GOTO command directs script file execution to the line in the script\r\n"\r | |
210 | " file after the given label. The command is not supported from the\r\n"\r | |
211 | " interactive shell.\r\n"\r | |
212 | " 2. A label is a line beginning with a colon (:). It can appear either after\r\n"\r | |
213 | " the GOTO command, or before the GOTO command. The search for label is\r\n"\r | |
214 | " done forward in the script file, from the current file position. If the\r\n"\r | |
215 | " end of the file is reached, the search resumes at the top of the file and\r\n"\r | |
216 | " continues until label is found or the starting point is reached. If label\r\n"\r | |
217 | " is not found, the script process terminates and an error message is\r\n"\r | |
218 | " displayed. If a label is encountered but there is no GOTO command\r\n"\r | |
219 | " executed, the label lines are ignored.\r\n"\r | |
220 | " 3. Using GOTO command to jump into another for loop is not allowed,\r\n"\r | |
221 | " but jumping into an if statement is legal.\r\n"\r | |
222 | ".SH EXAMPLES\r\n"\r | |
223 | " \r\n"\r | |
224 | "EXAMPLES:\r\n"\r | |
225 | " * This is a script:\r\n"\r | |
226 | " goto Done\r\n"\r | |
227 | " ...\r\n"\r | |
228 | " :Done\r\n"\r | |
229 | " cleanup.nsh\r\n"\r | |
230 | \r | |
231 | #string STR_GET_HELP_ENDIF #language en-US ""\r | |
232 | ".TH endif 0 "ends an if block"\r\n"\r | |
233 | ".SH NAME\r\n"\r | |
234 | "Ends the block of a script controlled by an 'if' statement.\r\n"\r | |
235 | ".SH SYNOPSIS\r\n"\r | |
236 | "See 'if' for usage.\r\n"\r | |
237 | ".SH EXAMPLES\r\n"\r | |
238 | "See 'if' for examples.\r\n"\r | |
239 | \r | |
240 | #string STR_GET_HELP_IF #language en-US ""\r | |
241 | ".TH if 0 "controls the execution of a block of a script"\r\n"\r | |
242 | ".SH NAME\r\n"\r | |
243 | "Executes commands in specified conditions.\r\n"\r | |
244 | ".SH SYNOPSIS\r\n"\r | |
245 | " \r\n"\r | |
246 | "IF [NOT] EXIST filename THEN\r\n"\r | |
247 | " command [arguments]\r\n"\r | |
248 | " [command [arguments]]\r\n"\r | |
249 | " ...\r\n"\r | |
250 | "[ELSE\r\n"\r | |
251 | " command [arguments]\r\n"\r | |
252 | " [command [arguments]]\r\n"\r | |
253 | " ...\r\n"\r | |
254 | " ]\r\n"\r | |
255 | "ENDIF\r\n"\r | |
256 | " \r\n"\r | |
257 | "IF [/i] [NOT] string1 == string2 THEN\r\n"\r | |
258 | " command [arguments]\r\n"\r | |
259 | " [command [arguments]]\r\n"\r | |
260 | " ...\r\n"\r | |
261 | "[ELSE\r\n"\r | |
262 | " command [arguments]\r\n"\r | |
263 | " [command [arguments]]\r\n"\r | |
264 | " ...\r\n"\r | |
265 | " ]\r\n"\r | |
266 | "ENDIF\r\n"\r | |
267 | "if [/i][/s] ConditionalExpression THEN\r\n"\r | |
268 | " command [arguments]\r\n"\r | |
269 | " [command [arguments]]\r\n"\r | |
270 | " ...\r\n"\r | |
271 | "[ELSE\r\n"\r | |
272 | " command [arguments]\r\n"\r | |
273 | " [command [arguments]]\r\n"\r | |
274 | " ...\r\n"\r | |
275 | " ]\r\n"\r | |
276 | "ENDIF\r\n"\r | |
277 | ".SH DESCRIPTION\r\n"\r | |
278 | " \r\n"\r | |
279 | "NOTES:\r\n"\r | |
280 | " 1. The IF command executes one or more commands before the ELSE or ENDIF\r\n"\r | |
281 | " commands, if the specified condition is TRUE; otherwise commands between\r\n"\r | |
282 | " ELSE (if present) and ENDIF are executed.\r\n"\r | |
283 | " 2. In the first usage of IF, the EXIST condition is true when the file\r\n"\r | |
284 | " specified by filename exists. The filename argument may include device\r\n"\r | |
285 | " and path information. Also wildcard expansion is supported by this form.\r\n"\r | |
286 | " If more than one file matches the wildcard pattern, the condition\r\n"\r | |
287 | " evaluates to TRUE.\r\n"\r | |
288 | " 3. In the second usage, the string1 == string2 condition is TRUE if the two\r\n"\r | |
289 | " strings are identical. Here the comparison can be case sensitive or\r\n"\r | |
290 | " insensitive, it depends on the optional switch /i. If /i is specified,\r\n"\r | |
291 | " it will compare strings in the case insensitive manner; otherwise, it\r\n"\r | |
292 | " compares strings in the case sensitive manner.\r\n"\r | |
293 | " 4. In the third usage, general purpose comparison is supported using\r\n"\r | |
294 | " expressions optionally separated by AND or OR. Since < and > are used for\r\n"\r | |
295 | " redirection, the expressions use common two character (FORTRAN)\r\n"\r | |
296 | " abbreviations for the operators (augmented with unsigned equivalents):\r\n"\r | |
297 | " - Expressions : Conditional expressions are evaluated strictly from left\r\n"\r | |
298 | " to right. Complex conditionals requiring precedence may\r\n"\r | |
299 | " be implemented as nested IFs.\r\n"\r | |
300 | " The expressions used in the third usage can have the\r\n"\r | |
301 | " following syntax:\r\n"\r | |
302 | " conditional-expression := expression |\r\n"\r | |
303 | " expression and expression |\r\n"\r | |
304 | " expression or expression\r\n"\r | |
305 | " expression := expr | not expr\r\n"\r | |
306 | " expr := item binop item | boolfunc(string)\r\n"\r | |
307 | " item := mapfunc(string) | string\r\n"\r | |
308 | " mapfunc := efierror | pierror | oemerror\r\n"\r | |
309 | " boolfunc := isint | exists | available | profile\r\n"\r | |
310 | " binop := gt | lt | eq | ne | ge | le | == | ugt | ult |\r\n"\r | |
311 | " uge | ule\r\n"\r | |
312 | " - Comparisons : By default, comparisons are done numerically if the\r\n"\r | |
313 | " strings on both sides of the operator are numbers\r\n"\r | |
314 | " (as defined below) and in case sensitive character sort\r\n"\r | |
315 | " order otherwise. Spaces separate the operators from\r\n"\r | |
316 | " operands.\r\n"\r | |
317 | " 5. The /s option forces string comparisons and the /i option forces\r\n"\r | |
318 | " case-insensitive string comparisons. If either of these is used, the\r\n"\r | |
319 | " signed or unsigned versions of the operators have the same results.\r\n"\r | |
320 | " The /s and /i apply to the entire line and must appear at the start of\r\n"\r | |
321 | " the line (just after the if itself). The two may appear in either order.\r\n"\r | |
322 | " 6. When performing comparisons, the Unicode Byte Ordering Character is\r\n"\r | |
323 | " ignored at the beginning of any argument.\r\n"\r | |
324 | " 7. Comparison Operator Definition:\r\n"\r | |
325 | " gt : Greater than\r\n"\r | |
326 | " ugt : Unsigned Greater than\r\n"\r | |
327 | " lt : Less than\r\n"\r | |
328 | " ult : Unsigned Less than\r\n"\r | |
329 | " ge : Greater than or equal\r\n"\r | |
330 | " uge : Unsigned greater than or equal\r\n"\r | |
331 | " le : Less than or equal\r\n"\r | |
332 | " ule : Unsigned less than or equal\r\n"\r | |
333 | " ne : Not equal\r\n"\r | |
334 | " eq : Equals (semantically equivalent to ==)\r\n"\r | |
335 | " == : Equals (semantically equivalent to eq)\r\n"\r | |
336 | " 8. Error Mapping Functions are used to convert integers into UEFI, PI or OEM\r\n"\r | |
337 | " error codes.\r\n"\r | |
338 | " Functions used to convert integers into UEFI, PI or OEM error codes:\r\n"\r | |
339 | " UefiError : Sets top nibble of parameter to 1000 binary (0x8)\r\n"\r | |
340 | " PiError : Sets top nibble of parameter to 1010 binary (0xA)\r\n"\r | |
341 | " OemError : Sets top nibble of parameter to 1100 binary (0xC)\r\n"\r | |
342 | " Each function maps the small positive parameter into its equivalent error\r\n"\r | |
343 | " classification.\r\n"\r | |
344 | " For example:\r\n"\r | |
345 | " if %lasterror% == EfiError(8) then # Check for write protect.\r\n"\r | |
346 | " ...\r\n"\r | |
347 | " 9. Boolean Functions may only be used to modify operators in comparisons.\r\n"\r | |
348 | " The following built-in Boolean functions are also available:\r\n"\r | |
349 | " IsInt : Evaluates to true if the parameter string that follows\r\n"\r | |
350 | " is a number (as defined below) and false otherwise.\r\n"\r | |
351 | " Exists : Evaluates to true if the file specified by string exists\r\n"\r | |
352 | " is in the current working directory or false if not.\r\n"\r | |
353 | " Available : Evaluates to true if the file specified by string is in the\r\n"\r | |
354 | " current working directory or current path.\r\n"\r | |
355 | " Profile : Determines whether the parameter string matches one of the\r\n"\r | |
356 | " profile names in the profiles environment variable.\r\n"\r | |
357 | " 10. No spaces are allowed between function names and the open parenthesis,\r\n"\r | |
358 | " between the open parenthesis and the string or between the string and\r\n"\r | |
359 | " the closed parenthesis. Constant strings containing spaces must be\r\n"\r | |
360 | " quoted.\r\n"\r | |
361 | " 11. To avoid ambiguity and current or future incompatibility, users are\r\n"\r | |
362 | " strongly encouraged to surround constant strings that contain\r\n"\r | |
363 | " parenthesis with quotes in if statements.\r\n"\r | |
364 | " 12. Allowable number formats are decimal numbers and C-style case\r\n"\r | |
365 | " insensitive hexadecimal numbers. Numbers may be preceded by a\r\n"\r | |
366 | " "-" indicating a negative number.\r\n"\r | |
367 | " Examples:\r\n"\r | |
368 | " 13\r\n"\r | |
369 | " 46\r\n"\r | |
370 | " -0x3FFF\r\n"\r | |
371 | " 0x3fff\r\n"\r | |
372 | " 0x1234\r\n"\r | |
373 | " 13. Unsigned values must be less than 264. Signed integer values are bounded\r\n"\r | |
374 | " by -/+263.\r\n"\r | |
375 | " 14. Numbers are internally represented in two's compliment form. The\r\n"\r | |
376 | " representation of the number in the string has no bearing on the way\r\n"\r | |
377 | " that number is treated in an numeric expression - type is assigned by\r\n"\r | |
378 | " the operator. So, for example, -1 lt 2 is true but -1 ult 2 is false.\r\n"\r | |
379 | " 15. The IF command is only available in scripts.\r\n"\r | |
380 | " 16. The ELSE command is optional in an IF/ELSE statement.\r\n"\r | |
381 | ".SH EXAMPLES\r\n"\r | |
382 | " \r\n"\r | |
383 | "EXAMPLES:\r\n"\r | |
384 | " * Sample script for "if" command usages 1 and 2:\r\n"\r | |
385 | " if exist fs0:\myscript.nsh then\r\n"\r | |
386 | " myscript myarg1 myarg2\r\n"\r | |
387 | " endif\r\n"\r | |
388 | " if %myvar% == runboth then\r\n"\r | |
389 | " myscript1\r\n"\r | |
390 | " myscript2\r\n"\r | |
391 | " else\r\n"\r | |
392 | " echo ^%myvar^% != runboth\r\n"\r | |
393 | " endif\r\n"\r | |
394 | " Note: In this example, if the script file myscript.nsh exists in fs0:\,\r\n"\r | |
395 | " this script will be launched with 2 arguments, myarg1 and myarg2.\r\n"\r | |
396 | " After that, environment variable %myvar% is checked to see if its\r\n"\r | |
397 | " value is runboth, if so, script myscript1 and myscript2 will be\r\n"\r | |
398 | " executed one after the other, otherwise a message %myvar% != runboth\r\n"\r | |
399 | " is printed.\r\n"\r | |
400 | " \r\n"\r | |
401 | " * Sample script for "if" command usage 3:\r\n"\r | |
402 | " :Redo\r\n"\r | |
403 | " echo Enter 0-6 or q to quit\r\n"\r | |
404 | " # assumes "input y" stores a character of user input into variable y\r\n"\r | |
405 | " InputCh MyVar\r\n"\r | |
406 | " if x%MyVar% eq x then\r\n"\r | |
407 | " echo Empty line. Try again\r\n"\r | |
408 | " goto Redo\r\n"\r | |
409 | " endif\r\n"\r | |
410 | " if IsInt(%MyVar%) and %MyVar% le 6 then\r\n"\r | |
411 | " myscript1 %MyVar%\r\n"\r | |
412 | " goto Redo\r\n"\r | |
413 | " endif\r\n"\r | |
414 | " if /i %MyVar% ne q then\r\n"\r | |
415 | " echo Invalid input\r\n"\r | |
416 | " goto Redo\r\n"\r | |
417 | " endif\r\n"\r | |
418 | " Note: In this example, the script requests user input and uses the if\r\n"\r | |
419 | " command for input validation. It checks for empty line first and\r\n"\r | |
420 | " then range checks the input.\r\n"\r | |
421 | \r | |
422 | #string STR_GET_HELP_SHIFT #language en-US ""\r | |
423 | ".TH shift 0 "move parameters 1 down"\r\n"\r | |
424 | ".SH NAME\r\n"\r | |
425 | "Shifts in-script parameter positions.\r\n"\r | |
426 | ".SH SYNOPSIS\r\n"\r | |
427 | " \r\n"\r | |
428 | "SHIFT\r\n"\r | |
429 | ".SH DESCRIPTION\r\n"\r | |
430 | " \r\n"\r | |
431 | "NOTES:\r\n"\r | |
432 | " 1. The SHIFT command shifts the contents of a UEFI Shell script's positional\r\n"\r | |
433 | " parameters so that %1 is discarded, %2 is copied to %1, %3 is copied to\r\n"\r | |
434 | " %2, %4 is copied to %3 and so on. This allows UEFI Shell scripts to\r\n"\r | |
435 | " process script parameters from left to right.\r\n"\r | |
436 | " 2. This command does not change the UEFI shell environment variable\r\n"\r | |
437 | " lasterror.\r\n"\r | |
438 | " 3. The SHIFT command is available only in UEFI Shell scripts.\r\n"\r | |
439 | ".SH EXAMPLES\r\n"\r | |
440 | " \r\n"\r | |
441 | "EXAMPLES:\r\n"\r | |
442 | " * Following script is a sample of 'shift' command:\r\n"\r | |
443 | " fs0:\> type shift.nsh\r\n"\r | |
444 | " #\r\n"\r | |
445 | " # shift.nsh\r\n"\r | |
446 | " # \r\n"\r | |
447 | " echo %1 %2 %3\r\n"\r | |
448 | " shift\r\n"\r | |
449 | " echo %1 %2\r\n"\r | |
450 | " \r\n"\r | |
451 | " * To execute the script with echo on:\r\n"\r | |
452 | " fs0:\> shift.nsh welcome UEFI world\r\n"\r | |
453 | " shift.nsh> echo welcome UEFI world\r\n"\r | |
454 | " welcome UEFI world\r\n"\r | |
455 | " shift\r\n"\r | |
456 | " echo UEFI world\r\n"\r | |
457 | " UEFI world\r\n"\r | |
458 | " \r\n"\r | |
459 | " * To execute the script with echo off:\r\n"\r | |
460 | " fs0:\> echo -off\r\n"\r | |
461 | " fs0:\> shift.nsh welcome UEFI world\r\n"\r | |
462 | " welcome UEFI world\r\n"\r | |
463 | " UEFI world\r\n"\r | |
464 | \r | |
465 | #string STR_GET_HELP_ELSE #language en-US ""\r | |
466 | ".TH else 0 "part of an 'if' conditional statement"\r\n"\r | |
467 | ".SH NAME\r\n"\r | |
468 | "Identifies the code executed when 'if' is FALSE.\r\n"\r | |
469 | ".SH SYNOPSIS\r\n"\r | |
470 | "See 'else' for usage.\r\n"\r | |
471 | ".SH EXAMPLES\r\n"\r | |
472 | "See 'if' for examples.\r\n"\r | |
473 | \r | |
474 | #string STR_GET_HELP_STALL #language en-US ""\r | |
475 | ".TH stall 0 "stall the operation"\r\n"\r | |
476 | ".SH NAME\r\n"\r | |
477 | "Stalls the operation for a specified number of microseconds.\r\n"\r | |
478 | ".SH SYNOPSIS\r\n"\r | |
479 | " \r\n"\r | |
480 | "STALL time\r\n"\r | |
481 | ".SH OPTIONS\r\n"\r | |
482 | " \r\n"\r | |
483 | " time - The number of microseconds for the processor to stall.\r\n"\r | |
484 | ".SH DESCRIPTION\r\n"\r | |
485 | " \r\n"\r | |
486 | "NOTES:\r\n"\r | |
487 | " 1. This command would be used to establish a timed STALL of operations\r\n"\r | |
488 | " during a script.\r\n"\r | |
489 | " 2. Microseconds is in decimal units.\r\n"\r | |
490 | ".SH EXAMPLES\r\n"\r | |
491 | " \r\n"\r | |
492 | "EXAMPLES:\r\n"\r | |
493 | " * To stall the processor for 1000000 microseconds:\r\n"\r | |
494 | " Shell> stall 1000000\r\n"\r | |
495 | ".SH RETURNVALUES\r\n"\r | |
496 | " \r\n"\r | |
497 | "RETURN VALUES:\r\n"\r | |
498 | " SHELL_SUCCESS The action was completed as requested.\r\n"\r | |
499 | " SHELL_NOT_FOUND The requested option was not found.\r\n"\r | |
500 | " SHELL_INVALID_PARAMETER One of the passed in parameters was incorrectly\r\n"\r | |
501 | " formatted or its value was out of bounds.\r\n"\r | |
502 | " SHELL_DEVICE_ERROR There was a hardware error associated with this\r\n"\r | |
503 | " request.\r\n"\r | |
504 | \r |