paused development. no functional version
executable for getting user input with simple line-editing. like readline for the shell, yet based on linenoise.
- left or right to move over characters
- ctrl+left or ctrl+right to move over words
- up or down to navigate input history
command-line interface:
usage: readline [options] [prompt] [historyfile]
description
read a line of user input with basic text editing.
examples
readline
readline "> "
readline "" /tmp/history
options
--help, -h
--version, -v
getting a line from the user in a shell script:
input = $(readline)
echo $input
- c 2011 standard library (for example musl-libc or glibc)
- posix 2008 features (for example linux or freebsd)
- for the provided compile script: shell, gcc
./exe/compile
the provided compile script uses gcc and musl-libc or glibc. it creates a statically compiled binary at exe/readline
.
it can be run directly from the project directory with ./exe/readline
. alternatively, it can be linked or copied anywhere else. it can be copied into one of the directories listed in the $PATH environment variable to be available as a shell command.
bsd-2