package async_interactive

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val interactive : bool Core.ref
val print_string : string -> unit Async.Deferred.t

These print* functions only print when !interactive.

val print_endline : string -> unit Async.Deferred.t
val printf : ('r, unit, string, unit Async.Deferred.t) Core.format4 -> 'r
val prints : string -> 'a -> ('a -> Async.Sexp.t) -> unit Async.Deferred.t
val print_s : Async.Sexp.t -> unit Async.Deferred.t
val ask_dispatch_gen : f:(string -> ('a, string) Core.Result.t) -> string -> 'a Async.Deferred.t
module Choice : sig ... end
val ask_dispatch_with_help : ?show_options:bool -> ?show_help:bool -> string -> 'a Choice.t list -> 'a Async.Deferred.t

ask_dispatch_gen question choices displays question and gets user input to select one of the choices. At most once choice can be the default choice.

val ask_yn : ?default:bool -> string -> bool Async.Deferred.t
val ask_ynf : ?default:bool -> ('a, unit, string, bool Async.Deferred.t) Core.format4 -> 'a
val arithmetic_challenge_exn : ?red:unit -> unit -> unit Async.Deferred.t

This will prompt the user to solve a math problem and exit if they fail. red will make the prompt print in red the the screen to make it more visually loud

This will raise if no input or incorrect input is given

val show_file : ?pager:string -> ?msg:string -> file:string -> unit -> unit Async.Deferred.t

These show* functions print even when not !interactive.

val show_string_with_pager : ?pager:string -> string -> unit Async.Deferred.t
val with_writer_to_pager : ?pager:string -> unit -> f:(Async.Writer.t -> 'a Async.Deferred.t) -> 'a Async.Deferred.t
module Job : sig ... end
OCaml

Innovation. Community. Security.