1
0
mirror of https://github.com/nushell/nushell.git synced 2025-04-25 21:58:18 +02:00
nushell/src/shell/shell.rs
2019-08-09 17:36:43 +12:00

21 lines
742 B
Rust

use crate::commands::command::{CallInfo, EvaluatedStaticCommandArgs};
use crate::errors::ShellError;
use crate::stream::{InputStream, OutputStream};
pub trait Shell {
fn name(&self) -> String;
fn ls(&self, args: EvaluatedStaticCommandArgs) -> 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>;
}