equal
deleted
inserted
replaced
|
1 #!fshell |
|
2 # tscriptargs.script |
|
3 # |
|
4 # Copyright (c) 2010 Accenture. All rights reserved. |
|
5 # This component and the accompanying materials are made available |
|
6 # under the terms of the "Eclipse Public License v1.0" |
|
7 # which accompanies this distribution, and is available |
|
8 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 # |
|
10 # Initial Contributors: |
|
11 # Accenture - Initial contribution |
|
12 # |
|
13 |
|
14 # Syntax: as per the CIF definition below, tscriptargs <myarg> [<myoptionalarg>] |
|
15 |
|
16 source $SCRIPT_PATH\errordef.script |
|
17 |
|
18 var ARG_COUNT == 0 && $Error # Because myarg isn't optional we shouldn't even get this far if there's no options |
|
19 |
|
20 var myarg == "abc123" || $Error |
|
21 var EXPECTEDMYOPTIONALARG defined && var myoptionalarg == "$EXPECTEDMYOPTIONALARG" || $Error |
|
22 |
|
23 exit # Like __END__ in perl this stops the fshell parser tripping over the CIF data |
|
24 |
|
25 ==name tscriptargs |
|
26 |
|
27 ==short-description |
|
28 |
|
29 An example of a script that uses CIF syntax. |
|
30 |
|
31 ==argument string myarg |
|
32 |
|
33 An example argument. Fshell defines the environment variable $myarg based on what the first argument to the script is (ie $1). Must be set to "abc123". |
|
34 |
|
35 ==argument string myoptionalarg optional |
|
36 |
|
37 An optional argument. If specified must equal $MYEXPECTEDOPTIONALARG. |
|
38 |