nushell/src/commands/skip.rs
Yehuda Katz 69effbc9e7 Improve signature infrastructure
The `config` command uses different kinds of named arguments, which
illustrates how it works.
2019-05-31 22:54:15 -07:00

14 lines
303 B
Rust

use crate::errors::ShellError;
use crate::prelude::*;
pub fn skip(args: CommandArgs) -> Result<OutputStream, ShellError> {
let amount = args.positional[0].as_i64()?;
let input = args.input;
Ok(input
.skip(amount as u64)
.map(|v| ReturnValue::Value(v))
.boxed())
}