2019-08-19 05:16:39 +00:00
|
|
|
use crate::commands::WholeStreamCommand;
|
2019-08-12 05:51:13 +00:00
|
|
|
use crate::errors::ShellError;
|
|
|
|
use crate::prelude::*;
|
|
|
|
|
2019-08-19 05:16:39 +00:00
|
|
|
pub struct Debug;
|
|
|
|
|
|
|
|
impl WholeStreamCommand for Debug {
|
|
|
|
fn name(&self) -> &str {
|
|
|
|
"debug"
|
|
|
|
}
|
|
|
|
|
|
|
|
fn signature(&self) -> Signature {
|
|
|
|
Signature::build("debug")
|
|
|
|
}
|
2019-08-29 22:52:32 +00:00
|
|
|
|
|
|
|
fn usage(&self) -> &str {
|
|
|
|
"Debug input fed."
|
|
|
|
}
|
|
|
|
|
|
|
|
fn run(
|
|
|
|
&self,
|
|
|
|
args: CommandArgs,
|
|
|
|
registry: &CommandRegistry,
|
|
|
|
) -> Result<OutputStream, ShellError> {
|
|
|
|
debug(args, registry)
|
|
|
|
}
|
2019-08-19 05:16:39 +00:00
|
|
|
}
|
|
|
|
|
2019-08-12 05:51:13 +00:00
|
|
|
pub fn debug(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
|
|
|
|
let input = args.input;
|
|
|
|
|
|
|
|
Ok(input
|
|
|
|
.values
|
|
|
|
.map(|v| {
|
|
|
|
println!("{:?}", v);
|
|
|
|
ReturnSuccess::value(v)
|
|
|
|
})
|
|
|
|
.to_output_stream())
|
|
|
|
}
|