Something went wrong. Try again.
OCaml port of Linenoise
Something went wrong. Try again.
1234567891011121314151617181920212223let prompt = "> "
let line_editor ctx = let complete s = if String.starts_with ~prefix:"hel" s then [ "hello"; "hello, world!" ] else [] in Bruit.run ~complete ctx prompt
let () = let ctx = Bruit_unix.stdctx () in let rec loop () = match line_editor ctx with | String (Some s) -> Fmt.pr "%s\n%!" s; loop () | String None -> () | Ctrl_c -> Fmt.pr "\n%!"; loop () in loop ()