Skip to main content

Module prompt

Module prompt 

Source
Expand description

Search indexing for commands, guides, and extra documents. Interactive prompt helpers for CLI commands.

These functions wrap inquire to provide consistent prompts that respect the global interactivity mode. Each helper returns a Result that produces a user-cancelled error when the user presses Escape or Ctrl+C.

All functions require an interactive TTY. Call them only when CommandContext::is_interactive returns true.

Enums§

CommandCorrection
Outcome of a “did you mean X?” correction prompt.
RecoveryResult
Result of attempting interactive recovery for missing args.

Functions§

build_resume_command
Build a resume command string from the already-supplied args.
confirm_command_correction
Offer to correct an unknown command spelling. Never prompts when non-interactive; interactivity follows the same raw-args rules as try_recover_missing_args.
prompt_confirm
Prompt the user for a yes/no confirmation.
prompt_multi_select
Prompt the user to select multiple options from a list.
prompt_select
Prompt the user to select one option from a list.
prompt_text
Prompt the user for a free-text string input.
prompt_text_with_validation
Prompt the user for a free-text string with input validation.
try_recover_missing_args
Attempt to interactively recover from a clap MissingRequiredArgument error.