nushell/src/commands/args.rs
2019-05-11 15:59:57 -07:00

32 lines
568 B
Rust

use crate::object::Value;
use derive_new::new;
use std::collections::VecDeque;
#[derive(Debug, Default)]
pub struct ObjectStream {
queue: VecDeque<Value>,
}
#[derive(Debug, Default)]
pub struct Streams {
success: ObjectStream,
error: ObjectStream,
warning: ObjectStream,
debug: ObjectStream,
trace: ObjectStream,
verbose: ObjectStream,
}
#[derive(Debug, new)]
pub struct Args {
argv: Vec<Value>,
#[new(default)]
streams: Streams,
}
impl Args {
crate fn first(&self) -> Option<&Value> {
self.argv.first()
}
}