2002-2006
Sven Ehrke
Jocelyn
Fiat
ericb@gobosoft.com 7 July 2005

# input

## Description

Input a message from stdin.

## Parameters

message

  Description: Message to be echoed

  Domain: -

  Default: -

variable

  Description: variable which will hold the input value

  Domain: valid variable name

  Default: -

defaultvalue

  Description: If defined, this value is the default input value

  Domain: valid value (text)

  Default: -

validargs

  Description: If defined, this value defines the valid input values

  Domain: comma separated string containing valid input values

  Default: -

validregexp

  Description: If defined, this input value must be matched by the regular expression

  Domain: regular expression (text)

  Default: -

answer_required

  Description: If False, an empty input value is valid, otherwise the input value must be non empty

  Domain: valid boolean (True|False)

  Default: True

## RNG Specification

    <define name="input">
      <element name="input">
        <ref name="dir_if_unless"/>
        <attribute name="message"/>
        <attribute name="variable"/>
        <optional>
          <attribute name="defaultvalue"/>
          <attribute name="validargs"/>
          <attribute name="validregexp"/>
    	  <attribute name="answer_required">
              <!-- runtime evaluation
              <choice>
                <value>true</value>
                <value>false</value>
              </choice>
              -->
            </attribute>
        </optional>
      </element>
    </define>

## Examples

      <input message="Do you want to continue ?" variable="answer" defaultvalue="y" validargs="y,n" />
      <input message="Enter a string :" variable="answer" answer_required="true" />
      <input message="Enter a number :" variable="answer" validregexp="^[0-9]+$" answer_required="true" />