| |
1 |
'''II. [wiki:GraspSw STARGRASP Software Command Syntax Notes]''' |
| |
2 |
|
| |
3 |
[[TracNav(GraspContents)]] |
| |
4 |
|
| |
5 |
A '''command''' and '''argument=value''' syntax is used throughout the layers of STARGRASP software. This applies to the [wiki:GraspSwDemoScripts demo scripts] (written in Bourne Shell), the [wiki:GraspSwToolkit toolkit level commands] which can be executed on a "command line" or from your favorite scripting language, and the [wiki:GraspSwControllerCmd ASCII socket level interface implemented on the controller]. (It does not apply to the C API where the interface is a standard C-Language function call interface.) The following general rules apply: |
| |
6 |
|
| |
7 |
* Arguments always follow the command. |
| |
8 |
* Order is not important(*) |
| |
9 |
* Do '''not''' include dashes "-" or "--" in front of the argument. |
| |
10 |
* Do '''not''' include white space around the equal sign ("=") |
| |
11 |
* Enclose white space in a value with double quotes (or quotes appropriate for the scripting language you are using.) |
| |
12 |
|
| |
13 |
Examples: |
| |
14 |
{{{ |
| |
15 |
go nexp=3 etype=DARK comment="Some comment string w/ spaces" GOOD |
| |
16 |
go 3 Not recommended |
| |
17 |
go nexp = 3 WRONG |
| |
18 |
go nexp=3 etype=DARK comment=Some comment string WRONG |
| |
19 |
}}} |
| |
20 |
|
| |
21 |
---- |
| |
22 |
|
| |
23 |
(*) The only time order is important is when using a shorthand in which only the '''value''' is given (i.e., no '''argument''' and no '''='''). In this case, the command parser falls back on positional rules. This syntax is not recommended, because the full syntax is more explicit, provides a level of self-documentation in scripts, and is easier to make sense of in network traces. |