From 0dbd014d8bb2e370de86d81b16b8c8bbb4e7f43c Mon Sep 17 00:00:00 2001 From: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Date: Fri, 6 Oct 2023 18:54:15 +0200 Subject: [PATCH] Use long options for debug (#10621) Also add short options for `profile` --- crates/nu-command/src/debug/ast.rs | 2 +- crates/nu-command/src/debug/explain.rs | 3 ++- crates/nu-command/src/debug/profile.rs | 6 +++--- crates/nu-command/src/debug/view_span.rs | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/nu-command/src/debug/ast.rs b/crates/nu-command/src/debug/ast.rs index 1ccabdc71b..1c85396d55 100644 --- a/crates/nu-command/src/debug/ast.rs +++ b/crates/nu-command/src/debug/ast.rs @@ -149,7 +149,7 @@ impl Command for Ast { }, Example { description: "Print the ast of a pipeline with an error, as json, minified", - example: "ast 'for x in 1..10 { echo $x ' -j -m", + example: "ast 'for x in 1..10 { echo $x ' --json --minify", result: None, }, ] diff --git a/crates/nu-command/src/debug/explain.rs b/crates/nu-command/src/debug/explain.rs index 39acd835d5..22937cfbef 100644 --- a/crates/nu-command/src/debug/explain.rs +++ b/crates/nu-command/src/debug/explain.rs @@ -51,7 +51,8 @@ impl Command for Explain { fn examples(&self) -> Vec { vec![Example { description: "Explain a command within a closure", - example: "explain {|| ls | sort-by name type -i | get name } | table -e", + example: + "explain {|| ls | sort-by name type --ignore-case | get name } | table --expand", result: None, }] } diff --git a/crates/nu-command/src/debug/profile.rs b/crates/nu-command/src/debug/profile.rs index 6449943fef..efef90101a 100644 --- a/crates/nu-command/src/debug/profile.rs +++ b/crates/nu-command/src/debug/profile.rs @@ -34,8 +34,8 @@ Current known limitations are: SyntaxShape::Closure(Some(vec![SyntaxShape::Any])), "the closure to run", ) - .switch("source", "Collect source code in the report", None) - .switch("values", "Collect values in the report", None) + .switch("source", "Collect source code in the report", Some('s')) + .switch("values", "Collect values in the report", Some('v')) .named( "max-depth", SyntaxShape::Int, @@ -95,7 +95,7 @@ Current known limitations are: vec![Example { description: "Profile some code, stepping into the `spam` command and collecting source.", - example: r#"def spam [] { "spam" }; profile {|| spam | str length } -d 2 --source"#, + example: r#"def spam [] { "spam" }; profile {|| spam | str length } --max-depth 2 --source"#, result: None, }] } diff --git a/crates/nu-command/src/debug/view_span.rs b/crates/nu-command/src/debug/view_span.rs index 30e564f3e4..4c9b48d7e9 100644 --- a/crates/nu-command/src/debug/view_span.rs +++ b/crates/nu-command/src/debug/view_span.rs @@ -60,8 +60,8 @@ impl Command for ViewSpan { fn examples(&self) -> Vec { vec![Example { - description: "View the source of a span. 1 and 2 are just example values. Use the return of debug -r to get the actual values", - example: r#"some | pipeline | or | variable | debug -r; view span 1 2"#, + description: "View the source of a span. 1 and 2 are just example values. Use the return of debug --raw to get the actual values", + example: r#"some | pipeline | or | variable | debug --raw; view span 1 2"#, result: None, }] }