The choice program

'choice' is a small command-line utility for giving the user a list of choices, and returning the chosen one via the exit code - very handy for command scripts.

Prompts the user, giving them a choice.

CHOICE prompt [ choice1 [ choice2 [ choice3 ... ] ] ]

 prompt   The text to display to the user before listing the choices.
 choiceN  Any number of choices for the user may be specified.

If no choices are specified, CHOICE gives the users the choices y and n.

The user must either enter one of the options, or enter nothing. Anything else,
causes CHOICE to prompt the user again.

The exit code of CHOICE is the index of the choice the user made, with 1 being
the first choice. If, for any reason, no option was chosen, CHOICE exits with
an exit code of 0.

Downloads

Build 20020927 is available for download.

Powered by the Content Parser System, copyright 2002 - 2009 James G. Ross.