Giter Club home page Giter Club logo

rline's Introduction

rline

Package rline provides a standard API wrapping the "readline" packages (readline, replxx), and provides a comparable implementation written in pure Go.

Quickstart Example

A comprehensive example is available:

# get source and build
$ git clone https://github.com/xo/rline.git && cd rline

# build dependencies
$ ./deps.sh

# build and run the example with readline and replxx support
$ go build -o example -tags 'rline_readline rline_replxx' ./_example
$ ./example

Please see _example/example.go for an overview of using the rline package.

Building

Both the readline and replxx libraries require static build artifacts in the ${SRCDIR}/{readline,replxx} directories. These can be built with the included deps.sh script:

# build readline and replxx dependencies
$ cd /path/to/rline
$ ./deps.sh

Build Tags

The readline and replxx libraries require CGO, and will not be included in a build by default. Both or either can be included by specifying an appropriate build tag:

# build with readline support
$ go build -tags rline_readline

# build with replxx support
$ go build -tags rline_replxx

# build with both readline and replxx support
$ go build -tags 'rline_readline rline_replxx'

Dynamic

The readline prompt can be linked against a system's standard or packaged readline library by using the rline_readline_dynamic tag:

# build with dynamic readline
$ go build -tags 'rline_readline_dynamic'

Project Goals

Aims to provide a drop in replacement with comparable feature support to GNU's readline library in pure Go, including (but not limited to):

  1. inputrc support (or similar)
  2. Comprehensive Windows support
  3. Tab completion

And to do so with a Go-idiomatic API that allows runtime switching between prompts.

Additionally, an aim of this project is to provide higher-level functionality not available in the standard readline library:

  1. Syntax highlighting
  2. Completion menus

About

rline was built primarily to support these projects:

  • usql - a universal command-line interface for SQL databases

rline's People

Contributors

kenshaw avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.