Question

How do I ask the user for more than one parameter in the same screen?

How do I ask the user for more than one parameter in the same screen?

Answer:

You can ask for multiple parameters in the same screen using a parameterGroup parameter, as shown in the example. Please note that parameter groups also need to contain a <name> tag.

<parameterGroup>
 <name>userandpass</name>
 <explanation>Please enter the username and password for your database.</explanation>
 <parameterList>
 <stringParameter>
    <name>username</name>
    <default>admin</default>
    <description>Username</description>
  </stringParameter>
  <passwordParameter>
    <ask>yes</ask>
    <name>masterpass</name>
    <description>Password</description>
    <descriptionRetype>Retype password</descriptionRetype>
    <explanation>Please provide a password for the database user</explanation>
    <cliOptionName>password</cliOptionName>
  </passwordParameter>
  </parameterList>
</parameterGroup>