Trait shrs_core::lang::Lang

source ·
pub trait Lang {
    // Required methods
    fn eval(
        &self,
        sh: &Shell,
        ctx: &mut Context,
        rt: &mut Runtime,
        cmd: String
    ) -> Result<CmdOutput>;
    fn name(&self) -> String;
    fn needs_line_check(&self, state: &LineStateBundle<'_>) -> bool;
}
Expand description

Trait to implement a shell command language

Required Methods§

source

fn eval( &self, sh: &Shell, ctx: &mut Context, rt: &mut Runtime, cmd: String ) -> Result<CmdOutput>

source

fn name(&self) -> String

source

fn needs_line_check(&self, state: &LineStateBundle<'_>) -> bool

Called when enter is pressed in line to check if the command is complete or needs another line. Use state.line.get_full_command()

Implementors§