Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MovingtoMars/liner
A readline-like library in Rust.
https://github.com/MovingtoMars/liner
Last synced: about 2 months ago
JSON representation
A readline-like library in Rust.
- Host: GitHub
- URL: https://github.com/MovingtoMars/liner
- Owner: MovingtoMars
- License: mit
- Created: 2016-07-02T01:11:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T03:58:30.000Z (almost 2 years ago)
- Last Synced: 2024-07-18T00:38:11.520Z (5 months ago)
- Language: Rust
- Size: 152 KB
- Stars: 74
- Watchers: 3
- Forks: 23
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-cn - MovingtoMars/liner - like functionality [<img src="https://api.travis-ci.org/MovingtoMars/liner.svg">](https://travis-ci.org/MovingtoMars/liner) (Libraries / Command-line)
- awesome-rust - MovingtoMars/liner - like functionality [<img src="https://api.travis-ci.org/MovingtoMars/liner.svg">](https://travis-ci.org/MovingtoMars/liner) (Libraries / Command-line)
- awesome-rust - MovingtoMars/liner - like functionality (Libraries / Command-line)
- awesome-rust-cn - MovingtoMars/liner
- awesome-rust-zh - MovingtoMars/liner - 提供类似 readline 功能的库[<img src="https://api.travis-ci.org/MovingtoMars/liner.svg">](https://travis-ci.org/MovingtoMars/liner) (库 / 命令行)
- awesome-rust - MovingtoMars/liner - A library offering readline-like functionality (Libraries / Command-line)
- awesome-rust - MovingtoMars/liner - like functionality [<img src="https://api.travis-ci.org/MovingtoMars/liner.svg">](https://travis-ci.org/MovingtoMars/liner) (库 Libraries / 命令行 Command-line)
- fucking-awesome-rust - MovingtoMars/liner - A library offering readline-like functionality (Libraries / Command-line)
- fucking-awesome-rust - MovingtoMars/liner - A library offering readline-like functionality (Libraries / Command-line)
README
# liner
A Rust library offering readline-like functionality.[CONTRIBUTING.md](/CONTRIBUTING.md)
[![crates.io](https://meritbadge.herokuapp.com/liner)](https://crates.io/crates/liner)
[![Build Status](https://travis-ci.org/MovingtoMars/liner.svg)](https://travis-ci.org/MovingtoMars/liner)
[![Docs](https://docs.rs/liner/badge.svg)](https://docs.rs/liner/)## Featues
- [x] Autosuggestions
- [x] Emacs and Vi keybindings
- [x] Multi-line editing
- [x] History
- [x] (Incomplete) basic and filename completions
- [ ] Reverse search
- [ ] Remappable keybindings## Basic Usage
In `Cargo.toml`:
```toml
[dependencies]
liner = "0.4.3"
...
```In `src/main.rs`:
```rust
extern crate liner;use liner::Context;
fn main() {
let mut con = Context::new();loop {
let res = con.read_line("[prompt]$ ", &mut |_| {}).unwrap();if res.is_empty() {
break;
}con.history.push(res.into());
}
}
```**See src/main.rs for a more sophisticated example.**
## License
MIT licensed. See the `LICENSE` file.