clearprompt
Prompt for user input
APPLICABILITY
ClearCase (command)
SYNOPSIS
- Prompt for text:
- clearprompt text -out·file pname [ -mul·ti_line ]
- [ -def·ault string | -dfi·le pname ]
-pro·mpt prompt_string
- Prompt for pathname:
- clearprompt file -out·file pname [ -pat·tern match_pattern ]
- [ -def·ault filename | -dfi·le pname ] [ -dir·ectory dir_path ]
-pro·mpt prompt_string
- Prompt for list:
- clearprompt list -out·file pname [ -items choice[,choice] [ -choices ] | -dfi·le pname ]
- -pro·mpt prompt_string
- Prompt for continue-processing choice:
- clearprompt proceed [ -typ·e type ] [ -def·ault choice ]
- [ -mas·k choice[,choice] ] -pro·mpt prompt_string
- Prompt for yes-no choice:
- clearprompt yes_no [ -typ·e type ] [ -def·ault choice ]
- [ -mas·k choice[,choice] ] -pro·mpt prompt_string
proceed choice is one of: proceed, abort
yes_no choice is one of: yes, no, abort
type is one of: ok, warning, error
DESCRIPTION
Using pop-up windows, the clearprompt command prompts the user for input, then either stores the input in a file or returns an appropriate exit status. clearprompt is designed for use in trigger action and GUI scripts. (See the mktrtype reference page.)
A trigger action script (or any other script) can use the exit status of clearprompt proceed or clearprompt yes_no to perform conditional processing:
| User selects
| Exit status
|
yes
| 0
|
proceed
| 0
|
no
| 1
|
abort
| 2
|
If an error occurs in clearprompt itself, the exit status is an integer greater than 9.
OPTIONS AND ARGUMENTS
- text [ -mul·ti_line ]
- file
- list
- proceed
- yes_no
- (Mutually exclusive) Specifies the kind of user input to be prompted for:
- text prompts for a single text line (with no trailing <NL> character). text -multi_line works just like cleartool comment input: in command-line mode, the user can enter any number of lines.
- file prompts for a file name.
- list prompts for a choice from a list of items.
- proceed prompts for a choice between the alternatives proceed and abort. The default for this option is proceed unless you override it by specifying -default abort.
- yes_no prompts for a choice among the alternatives yes, no, and abort. The default for this option is yes unless you override it by specifying -default no or -default abort.
- -out·file pname
- Specifies the file to which the user's input is written.
- -def·ault string
- Specifies the default text to be written to the -outfile file if the user clicks OK .
- -def·ault filename
- Specifies the default file name string to be written to the -outfile file if the user clicks OK .
- -dfi·le pname
- A variant of -default; reads the default text from a file instead of the command line. With the list argument, -dfile reads a list of comma-separated items from a file instead of from the command line.
- -def·ault choice
- Specifies the choice made if the user clicks OK . The specified default is silently included in the -mask list.
- -typ·e type
- Specifies the severity level: ok, warning, or error. The only effect is in the way the user is prompted for input.
- -ite·ms choice[,choice]
- Restricts the universe of choices for a list interaction.
- -choices
- Allows the user to select more than one choice from the list.
- -mas·k choice[,choice]
- Restricts the choices for a proceed or yes_no interaction. Defaults for proceed and yes_no, whether or not they are explicitly specified, are included among the -mask arguments.
- -pat·tern match_pattern
- -dir·ectory dir_path
- The file prompt window contains a pathname filter. By default, this window displays the names of all files in the current working directory. You can use the -directory and/or -pattern option to specify a different directory and/or file name pattern (for example, *.c) to restrict which file names are displayed. The user can change the filter after the file browser appears.
- -pro·mpt prompt_string
- Specifies a message to be displayed, presumably explaining the nature of the interaction.
EXAMPLES
NOTE: See the mktrtype reference page for additional examples.
- Prompt the user to enter a name, writing the user's input to file uname. Use the value of the USER environment variable if the user presses RETURN.
Z:\myvob> clearprompt text -outfile uname -default %USER% ^
-prompt "Enter User Name:"
- Ask a question and prompt for a yes/no response. Make the default response no.
y:\> clearprompt yes_no -prompt "Do You Want to Continue?" ^
-default no -mask yes,no
- Ask a question and prompt for a yes/abort response, excluding no as a choice. The default is yes because no default is explicitly specified.
y:\> clearprompt yes_no -prompt "OK to continue?" -mask abort
- Prompt for a file name. Restrict the choices to files with a .c extension, and write the user's selection to a file named myfile.
c:\> clearprompt file -prompt "Select File From List" -outfile myfile ^
-pattern '*.c'
SEE ALSO
mktrigger, mktrtype
Feedback on the documentation in this site? We welcome any comments!
Copyright © 1999 by Rational Software Corporation. All rights reserved.
|