Crates.io | slaps |
lib.rs | slaps |
version | 0.2.3 |
source | src |
created_at | 2020-07-25 17:17:18.322058 |
updated_at | 2020-07-27 10:11:24.782324 |
description | Interactive shell interface using your existing Clap/StructOpt config |
homepage | |
repository | https://github.com/tjg1/slaps |
max_upload_size | |
id | 269529 |
size | 137,708 |
Slaps adds an interactive CLI mode to your Rust command-line applications using your existing Clap configuration.
It combines Clap with rustyline to provide line editing, auto-completion and syntax highlighting.
This:
use slaps::Slaps;
// Using structopt
Slaps::with_name("slaps")
.command(RekeyCommand::clap(), |args| Ok(()))
.command(AccountCommand::clap(), |args| Ok(()))
.command(UndoCommand::clap(), |args| Ok(()))
.run()?;
Gets you this:
Zero extra configuration needed.
This project is currently in early stages of development and any changes are motivated by it being part of my personal
toolkit to quickly build Rust command-line applications.
Most of it was extracted wholesale from the first project I built while learning Rust.
It abuses the hell out of Clap's doc(hidden)
internals to minimise the overhead of the glue code holding everything
together.
This makes things likely to break with future versions of Clap.
You have been warned, your warranty is now void, etc.