nushell/src/commands/next.rs

29 lines
660 B
Rust
Raw Normal View History

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