mirror of
https://github.com/nushell/nushell
synced 2025-01-06 02:09:10 +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.
39 lines
807 B
Rust
39 lines
807 B
Rust
use crate::commands::WholeStreamCommand;
|
|
use crate::errors::ShellError;
|
|
use crate::prelude::*;
|
|
|
|
pub struct Debug;
|
|
|
|
impl WholeStreamCommand for Debug {
|
|
fn name(&self) -> &str {
|
|
"debug"
|
|
}
|
|
|
|
fn signature(&self) -> Signature {
|
|
Signature::build("debug")
|
|
}
|
|
|
|
fn usage(&self) -> &str {
|
|
"Debug input fed."
|
|
}
|
|
|
|
fn run(
|
|
&self,
|
|
args: CommandArgs,
|
|
registry: &CommandRegistry,
|
|
) -> Result<OutputStream, ShellError> {
|
|
debug(args, registry)
|
|
}
|
|
}
|
|
|
|
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())
|
|
}
|