[][src]Module bdrck::cli

Utilities for command-line interfaces.

Structs

MaybePromptedString

MaybePromptedString is a wrapper for getting user input interactively, while also allowing the value to be specified at call time. This is useful e.g. when we want to prompt users interactively, but want to predefine the values in unit tests, or when users can specify a value either interactively or via flags.

Enums

Stream

Standard input / output streams.

Functions

continue_confirmation

Display a " Continue?" confirmation. Returns true if the user replies "yes" (or similar), or false otherwise.

isatty

Return whether or not the given stream is a TTY (as opposed to, for example, a pipe).

prompt_for_string

Prompt the user for a string (read from Stdin) using the given output stream (Stdout or Stderr) to display the given prompt message.

prompt_for_string_confirm

Prompt for a string as per prompt_for_string, but additionally have the user enter the value again to confirm we get the same answer twice. This is useful for e.g. password entry.