B.20 InputTask
Prev | Appendix B. Core tasks | Next

## B.20 InputTask

The `InputTask` can be used to interactively set property values based on input from the console (or other Reader).

Table B.21: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`propertyName` | `String` | The name of the property to set. | n/a | No
`defaultValue` | `String` | The default value to be set if no new value is provided. | n/a | Yes
`message` | `String` | Prompt text (same as CDATA). | n/a | Yes
`promptChar` | `String` | The prompt character to follow prompt text. | n/a | No
`validArgs` | `String` | Comma-separated list of valid choices the user must supply. If used, one of these options must be chosen. | n/a | No

### B.20.1 Examples

    <!-- Getting string input -->
    <echo>HTML pages installing to: ${documentRoot}</echo>
    <echo>PHP classes installing to: ${servletDirectory}</echo>

    <input propertyname="documentRoot">Web application document root</input>
    <input propertyname="servletDirectory"
      defaultValue="/usr/servlets" promptChar="?">PHP classes install dir</input>

    <echo>HTML pages installed to ${documentRoot}</echo>
    <echo>PHP classes installed to ${servletDirectory}</echo>

    <!-- Having the user choose from a set of valid choices -->
    <echo>Choose a valid option:</echo>

    <input propertyname="optionsChoice" validargs="foo,bar,bob">
      Which item would you like to use
    </input>

Prev | Up | Next
B.19 IncludePathTask | Home | B.21 LoadFileTask