nushell/crates/nu-cli/src/commands/prev.rs

34 lines
761 B
Rust
Raw Normal View History

2019-08-07 19:49:11 +02:00
use crate::prelude::*;
use nu_errors::ShellError;
2019-11-30 01:21:05 +01:00
use nu_protocol::{CommandAction, ReturnSuccess, Signature};
2019-08-07 19:49:11 +02:00
use crate::commands::WholeStreamCommand;
pub struct Previous;
impl WholeStreamCommand for Previous {
fn name(&self) -> &str {
"p"
}
fn signature(&self) -> Signature {
Signature::build("p")
}
fn usage(&self) -> &str {
"Go to previous shell."
}
fn run(
&self,
args: CommandArgs,
registry: &CommandRegistry,
) -> Result<OutputStream, ShellError> {
previous(args, registry)
}
}
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())
}