7.12 Definition block for use case scripts

Each use case definition block must begin with a USECASE header line to define the start of a use case. Without the header, DS-5 does not recognize the script as a use case script.

Tags describe the content of a use case. Each tag is surrounded by dollar ($) signs to distinguish them from any other text. All tags are defined $<tag>$ <value> with the exception of the $Help$ tag. If a tag is defined in the use case definition block it can only be present once. Duplicate names of tags are not accepted in a single use case.

Only the $Run$ tag which describes the entry point or main method to the use case needs to be defined for a valid use case. To report meaningful help when searching for use case scripts on the DS-5 command-line, it is recommended that you also define the $Title$ and $Description$ tags in each use case.

Run

The $Run$ tag specifies the name of the entry point to a single use case. When you run a use case on the command line, it calls the method with the $Run$ tag. For details of how to define the entry point, and how to supply additional arguments to the method, see 7.13 Defining the Run method for use case scripts.

Example 7-2 Examples

...
$Run$ mainMethod
...

Title

The $Title$ tag specifies the title in a use case definition block. This is a single line string which is the title of this use case script and is displayed when searching for use case scripts on the command-line.

Example 7-3 Examples

...
$Title$ Usecase Title
...

Description

The $Description$ tag specifies the description in a use case definition block. This is a single line string which is the description of this use case and is displayed when searching for use case scripts on the command-line.

Example 7-4 Examples

...
$Description$ A brief description of this use case
...

Options

The $Options$ tag specifies a method within the use case script, which can be called to retrieve a list of options. For a description of how to define the options function, and how to construct a list of options, see 7.14 Defining the options for use case scripts.

Example 7-5 Examples

...
$Options$ myOptions
...

Validation

The $Validation$ tag specifies the validation method in the use case definition block. You must specify this to validate the options provided when the script is run. For a description of how to define the validation function, see 7.15 Defining the validation method for use case scripts.

Example 7-6 Examples

...
$Validation$ myValidation
...

Help

The use of $Help$ tags is slightly different from the use of other tags. The $Help$ tag enables writing a multiline block of text, which appears in the output when a user requests help about the use case script. This can be used to provide usage description, parameters for the use case scripts, or a more verbose help text.

To define a block of help text, enclose the block in $Help$ tags. Formatting, such as new lines and spaces are preserved in the $Help$ block. Everything, including the definition of other tags, are consumed within a $Help$ block. The $Help$ block must be completed before other tags or code is defined.

Example 7-7 Examples

$Help$
This is part of the help text
...
$Help$
Non-ConfidentialPDF file icon PDF versionARM DUI0446Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.