package ocamline
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
md5=b10a0fbce3bbaf2cac52e99a148d4ea4
sha512=3971622d10fe8c25e521272884fb46ac5a9ed1b54dbcbca1b84cbdab49eec869f0083df22ab2f46625faa052900c313e6ce2ac7317c0b8661d699fb749390540
Description
Added to opam-repository:
README

This library provides a simple interface for reading user input in OCaml programs. The goal of this project is to reduce the burden of reading user input for programming language REPLs.
The feature that makes this library particularly useful is its handling of brackets. Any brackets that are opened must be closed before input is accepted. This library uses ocaml-linenoise to provide rlwrap like functionality, including command history, arrow navigation, etc.
Example
Source Code:
read ~brackets:['(',')'] ~prompt:"lisp>" ()Command Line:
lisp> (lambda
(x)
(+ x 1))
lisp>API
val read : ?trim_delim:bool ->
?brackets:(char * char) list ->
?prompt:string ->
?strings:char list ->
?history_loc:string ->
?hints_callback:(string -> (string * LNoise.hint_color * bool) option) ->
?completion_callback:(string -> LNoise.completions -> unit) ->
?delim:string ->
unit ->
stringParameter | Description | Default Value |
|---|---|---|
| Whether or not to remove the line delimiter from the return value. |
|
| Any characters that once opened must be closed before the line is accepted |
|
| Customizes the prompt displayed to the user. |
|
| String delimiters. If brackets are in strings, they won't have to be closed. |
|
| Where to store the history for the user commands |
|
| Linenoise's hints callback. See here | No op |
| Linenoise's completion callback. See here | No op |
| The string that, when found, halts scanning and returns the input. |
|
Contributions
Contributions to ocamline are greatly appreciated! ❤️
Please try to keep its implementation unassuming and configurable. 🙂
Dev Dependencies (1)
-
alcotest
with-test
Optional Dependencies
None
Used by (1)
-
gobba
>= "0.4.2"
Conflicts
None
Build status
Results of building ocamline with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 1.2 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure