Font size:
Get-Opts
Description
GetOpts task parses the module's commandline options in the tradition of getopt(s)
Parameters
| Attribute | Description | Required |
|---|---|---|
| optsValue | The commandline options input (NOTE: optsProperty is deprecated) | Yes |
| failonerror | boolean flag for module to fail when get-opts error occurs. | Yes |
| errorProperty | property containing error (if any) | Yes |
| usageProperty | property to representing module usage (dynamically generated) | Yes |
| stopAtNonOption | Optional, if set to true, will modify the behavior of get-opts to stop at the 1st unrecognized property and set property identified by remainingArgsProperty to contain the rest of the command line. Must be used with remainingArgsProperty attribute. | No |
| remainingArgsProperty | Optional, when stopAtNonOption is set to true, property name to contain the rest of command line when unrecognized option is encountered. | No |
Parameters specified as nested elements
opts
Exactly one opts element.
NOTE: commander framework property ${cmd.line} will contain the options after the -- commandline separator and can be used as the input value to the get-opts optsValue attribute.
Examples
process module command line arguments
<get-opts optsValue="-object myObject -restart"
failonerror="true"
errorProperty="mymodule.error"
usageProperty="mymodule.usage">
<opts>
<opt parameter="object"
type="string"
property="object.value"
required="true"
description="object name"/>
<opt parameter="type"
type="string"
property="type.value"
required="false"
default="MyType"
description="optional type"/>
<opt parameter="restart"
type="boolean"
property="restart.value"
required="true"
description="restart flag"/>
</opts>
</get-opts>



