package inquire
Create beautiful interactive command line interface in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
inquire-0.3.0.tbz
sha256=c27d8f64c4ccd60ae5c64842b4326d28b04e8c9b4d547cb235062e165b4a6feb
sha512=e64ea7e1811e9010a4fa9faf61fd42ad3f7ec05a65053dbdcae4f0ee776b87f712270aff75d7c44ccc443f677251462f9357e07581b5790cd2a83593884513b5
README.md.html
Inquire
🎨 Create beautiful interactive command line interface in OCaml
Installation
Using Opam
opam install inquire
Using Esy
esy add @opam/inquire
Usage
Confirm
Prompt the user to answer the given message with "y" or "n".
Inquire.confirm "Are you sure?"
Raw List
Prompt the user to chose a value from the given options.
Inquire.raw_select "What's your favorite movie?" ~options:[ "Choice 1" ; "Choice 2" ]
Password
Prompt the user to enter a password that will be hidden with stars (*
).
Inquire.password "Enter your password:"
Input
Prompt the user to input a string.
Inquire.input "Enter a value:"
Limitations
Inquire is dead simple. The prompt implementations are ~100 line of code each and manage the terminal control flow themselves. This simplicity comes at a price though:
No support for UTF8. This would in principle be relatively easy to implement with a buffer that accumulates the input bytes until it matches an UTF8 value, up to a certain number of bytes. A PR for this would be more than welcome.
Contributing
Take a look at our Contributing Guide.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>