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