Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Latest commit

 

History

History
58 lines (46 loc) · 1.77 KB

readme.md

File metadata and controls

58 lines (46 loc) · 1.77 KB

readline-cli

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

dependencies

  • 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

setup

./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.

license

bsd-2

thanks

other

similar projects