Crates.io | shrs_rhai_completion |
lib.rs | shrs_rhai_completion |
version | 0.0.6 |
source | src |
created_at | 2024-04-16 04:14:41.06087 |
updated_at | 2024-06-01 04:58:58.43552 |
description | Rhai completions for shrs |
homepage | https://mrpicklepinosaur.github.io/shrs/ |
repository | https://github.com/MrPicklePinosaur/shrs |
max_upload_size | |
id | 1209941 |
size | 75,339 |
This is a plugin for shrs, which adds support for adding tab completion with Rhai scripts. Tab completions in various shells such as fish usually use scripts to handle completions and this plugin mirrors that. For shrs, this allows scripts to be decoupled from the shell code so they can be easily modified. There will also be a set of curated Rhai scripts which can easily be copied without having to build it into the shell. This also makes generating completions easy since other tools can be easily modified to generate Rhai scripts instead.
First add this plugin to your dependencies
shrs_rhai_completion = { version = "0.0.6" }
Then include this plugin when initializing shrs
Also, add completions scripts to ~/.config/shrs/completions A list of written completions can be found in completions
use shrs::prelude::*;
use shrs_completion::completions::*;
fn main() {
let myshell = ShellBuilder::default()
.with_plugin(CompletionsPlugin)
.build()
.unwrap();
myshell.run().unwrap();
}