NSHScript - addNSHScriptParameterByGroupAndName
NSHScript - addNSHScriptParameterByGroupAndName
Description :
This command adds a parameter with a value in the default value field to an NSH script. For a similar command that adds a parameter with a command argument and a value in the default value field, see addNSHScriptParameterByGroupAndName .
You must provide the name of the script and the fully qualified path to the depot group containing the script (for example, /NSHScripts/Utility).
The paramValueFlag argument is used to set characteristics for the parameter. The possible characteristics each have a value, as follows:
- 1 = parameter accepts value
- 2 = value must not be empty at run time
- 4 = value is editable
- 8 = parameter flag required at runtime
For paramValueFlag, add the values representing the properties you want to assign to the parameter. For example, a value of 5 sets the parameter to accept a value and be editable.
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
scriptGroup | String | Full path to the depot group containing the NSH script. |
scriptName | String | Display name of the NSH script. |
paramName | String | Name of parameter being added. |
paramDesc | String | Description of the added parameter. |
paramValue | String | Value of the added parameter. |
paramValueFlag | Integer | Number describing the characteristics of the parameter. See above for a more complete description. |
Example
The following example shows how to add a parameter to an existing NSH script. The parameter is editable and it cannot be empty at run time.
Script
NSHSCRIPT_GROUP=/nshscripts
NSHSCRIPT=reboot
PAR_NAME=delaytime
PAR_DESC="The time in seconds before reboot"
PAR_VALUE=60
PAR_FLAG=7
`blcli NSHScript clearNSHScriptParametersByGroupAndName $NSHSCRIPT_GROUP $NSHSCRIPT`
RESULT=`blcli NSHScript addNSHScriptParameterByGroupAndName $NSHSCRIPT_GROUP $NSHSCRIPT $PAR_NAME "$PAR_DESC" $PAR_VALUE $PAR_FLAG`