mirror of
https://github.com/nushell/nushell
synced 2025-01-04 01:09:05 +00:00
ca0c6eaf58
with the `help` command to explore and list all commands available. Enter will also try to see if the location to be entered is an existing Nu command, if it is it will let you inspect the command under `help`. This provides baseline needed so we can iterate on it.
33 lines
750 B
Rust
33 lines
750 B
Rust
use crate::commands::command::CommandAction;
|
|
use crate::errors::ShellError;
|
|
use crate::prelude::*;
|
|
|
|
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> {
|
|
Ok(vec![Ok(ReturnSuccess::Action(CommandAction::PreviousShell))].into())
|
|
}
|