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

executable for getting user input with simple line-editing

Notifications You must be signed in to change notification settings

sph-mn/readline-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

executable for getting user input with simple line-editing

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published