mirror of
https://github.com/nushell/nushell
synced 2025-01-25 11:25:21 +00:00
22 lines
801 B
Rust
22 lines
801 B
Rust
use crate::commands::command::CallInfo;
|
|
use crate::errors::ShellError;
|
|
use crate::shell::completer::CompletionPair;
|
|
use crate::stream::{InputStream, OutputStream};
|
|
use rustyline::error::ReadlineError;
|
|
|
|
pub trait Shell {
|
|
fn name(&self) -> String;
|
|
fn ls(&self, call_info: CallInfo, input: InputStream) -> Result<OutputStream, ShellError>;
|
|
fn cd(&self, call_info: CallInfo, input: InputStream) -> 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<CompletionPair>), ReadlineError>;
|
|
|
|
fn hint(&self, _line: &str, _pos: usize, _ctx: &rustyline::Context<'_>) -> Option<String>;
|
|
}
|