mirror of
https://github.com/danbulant/nushell
synced 2026-05-19 20:38:40 +00:00
21 lines
791 B
Rust
21 lines
791 B
Rust
use crate::commands::command::EvaluatedWholeStreamCommandArgs;
|
|
use crate::context::SourceMap;
|
|
use crate::errors::ShellError;
|
|
use crate::stream::OutputStream;
|
|
|
|
pub trait Shell {
|
|
fn name(&self, source_map: &SourceMap) -> String;
|
|
fn ls(&self, args: EvaluatedWholeStreamCommandArgs) -> Result<OutputStream, ShellError>;
|
|
fn cd(&self, args: EvaluatedWholeStreamCommandArgs) -> Result<OutputStream, ShellError>;
|
|
fn path(&self) -> String;
|
|
fn set_path(&mut self, path: String);
|
|
|
|
fn complete(
|
|
&self,
|
|
line: &str,
|
|
pos: usize,
|
|
ctx: &rustyline::Context<'_>,
|
|
) -> Result<(usize, Vec<rustyline::completion::Pair>), rustyline::error::ReadlineError>;
|
|
|
|
fn hint(&self, _line: &str, _pos: usize, _ctx: &rustyline::Context<'_>) -> Option<String>;
|
|
}
|