Defining the Run method for use case scripts
The method named in the
$Run$ tag must have at least one parameter, called
options, which provides access to the script options.
Example 7-7 Examples
... $Run$ mainMethod ...
def mainMethod(options): print "Running the main method"
It is possible to define an entry point to the use case that requires more than
one parameter. The definition of the
$Run$ tag only
defines the function name. The definition of the function within the script defines
how many parameters are needed.
Example 7-8 Examples
... $Run$ main ...
# main method with positional arguments def main(options, filename, value): print "Running the main method" # Using the positional arguments supplied to the script. print "Using file: " + filename + " and value: " + value
In this example
main requires two parameters,
value which must be supplied on the command-line when the use case
script is run.