package passage

  1. Overview
  2. Docs

Module Passage.PromptSource

User prompt and input utilities

Sourcetype prompt_reply =
  1. | NoTTY
  2. | TTY of bool
Sourceval is_TTY : bool
Sourceval yesno : string -> bool
Sourceval yesno_tty_check : string -> prompt_reply
Sourceval input_help_if_user_input : ?msg:string -> unit -> unit
Sourceval preprocess_content : string -> string
Sourceval get_valid_input_from_stdin_exn : unit -> (string, string) result

Gets and validates user input reading from stdin. If the input has the wrong format, the user is prompted to reinput the secret with the correct format. Allows passing in a function for input transformation. Throws an error if the transformed input doesn't comply with the format and the user doesn't want to fix the input format.