add back debug --raw switch (#401)

* add back debug --raw switch

* tweak some debug and other settings
This commit is contained in:
Darren Schroeder
2021-12-02 08:32:12 -06:00
committed by GitHub
parent 071066b6d9
commit f2aa952e86
4 changed files with 48 additions and 20 deletions

View File

@ -15,7 +15,11 @@ impl Command for Debug {
}
fn signature(&self) -> Signature {
Signature::build("debug").category(Category::Core)
Signature::build("debug").category(Category::Core).switch(
"raw",
"Prints the raw value representation",
Some('r'),
)
}
fn run(
@ -27,11 +31,21 @@ impl Command for Debug {
) -> Result<PipelineData, ShellError> {
let head = call.head;
let config = stack.get_config()?;
let raw = call.has_flag("raw");
input.map(
move |x| Value::String {
val: x.debug_string(", ", &config),
span: head,
move |x| {
if raw {
Value::String {
val: x.debug_value(),
span: head,
}
} else {
Value::String {
val: x.debug_string(", ", &config),
span: head,
}
}
},
engine_state.ctrlc.clone(),
)