Use long options for debug (#10621)

Also add short options for `profile`
This commit is contained in:
Hofer-Julian 2023-10-06 18:54:15 +02:00 committed by GitHub
parent d064d187ab
commit 0dbd014d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View File

@ -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,
},
]

View File

@ -51,7 +51,8 @@ impl Command for Explain {
fn examples(&self) -> Vec<Example> {
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,
}]
}

View File

@ -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,
}]
}

View File

@ -60,8 +60,8 @@ impl Command for ViewSpan {
fn examples(&self) -> Vec<Example> {
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,
}]
}