nushell/src/commands/prev.rs

30 lines
681 B
Rust
Raw Normal View History

2019-08-07 19:49:11 +02:00
use crate::commands::command::CommandAction;
use crate::errors::ShellError;
use crate::prelude::*;
use crate::commands::WholeStreamCommand;
pub struct Previous;
impl WholeStreamCommand for Previous {
fn run(
&self,
args: CommandArgs,
registry: &CommandRegistry,
) -> Result<OutputStream, ShellError> {
previous(args, registry)
}
fn name(&self) -> &str {
"p"
}
fn signature(&self) -> Signature {
Signature::build("p")
}
}
fn previous(_args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
2019-08-07 19:49:11 +02:00
Ok(vec![Ok(ReturnSuccess::Action(CommandAction::PreviousShell))].into())
}