1 unstable release

0.0.5 Apr 16, 2024

#849 in Command-line interface

Download history 165/week @ 2024-04-15

165 downloads per month

MIT/Apache

41KB
238 lines

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.5" }

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();
}

Dependencies

~19–34MB
~505K SLoC