shrs_rhai_completion

Crates.ioshrs_rhai_completion
lib.rsshrs_rhai_completion
version0.0.6
sourcesrc
created_at2024-04-16 04:14:41.06087
updated_at2024-06-01 04:58:58.43552
descriptionRhai completions for shrs
homepagehttps://mrpicklepinosaur.github.io/shrs/
repositoryhttps://github.com/MrPicklePinosaur/shrs
max_upload_size
id1209941
size75,339
Daniel Liu (MrPicklePinosaur)

documentation

README

shrs_rhai_completion

Support for adding completions with Rhai scripts

crates.io MIT/Apache 2.0

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.

Using this plugin

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();
}
Commit count: 440

cargo fmt