Constants§
- CANCELLED
- Error message used for a user cancellation (Esc, Ctrl+C, declining a confirmation).
- EXIT_
CANCELLED - Exit status for a cancelled operation (same convention as SIGINT).
Functions§
- cancelled
- Report a cancellation and return the error that makes the process exit 130.
- confirm
- Ask a yes/no question;
y/yes(any case) confirms. Withassume_yesthe question is answered automatically (for--yes). - exit_
code_ for_ error - Process exit code for a top-level error (130 = cancelled, 1 = failure).
- is_
cancelled - prompt_
for_ input - prompt_
for_ missing_ arg - prompt_
with_ default - Prompts with a suggested default (dimmed). Enter keeps default; Esc cancels.
- read_
line_ allow_ esc - Read one line with live echo. Esc (or Ctrl+C) returns
Ok(None). - read_
prompted_ line - Prompt shown already printed by caller; reads a line or cancels.
- read_
prompted_ line_ raw - Like
read_prompted_linebut keeps leading/trailing whitespace.