diff --git a/crates/nu-command/src/date/to_timezone.rs b/crates/nu-command/src/date/to_timezone.rs index 37250a8d1..71b537964 100644 --- a/crates/nu-command/src/date/to_timezone.rs +++ b/crates/nu-command/src/date/to_timezone.rs @@ -81,7 +81,7 @@ impl Command for SubCommand { vec![ Example { description: "Get the current date in UTC+05:00", - example: "date now | date to-timezone +0500", + example: "date now | date to-timezone '+0500'", result: None, }, Example { diff --git a/crates/nu-command/src/debug/explain.rs b/crates/nu-command/src/debug/explain.rs index a15a2c867..6285077bd 100644 --- a/crates/nu-command/src/debug/explain.rs +++ b/crates/nu-command/src/debug/explain.rs @@ -51,7 +51,7 @@ 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 -i | get name } | table -e", result: None, }] } diff --git a/crates/nu-command/src/debug/profile.rs b/crates/nu-command/src/debug/profile.rs index 19d833477..3a366d800 100644 --- a/crates/nu-command/src/debug/profile.rs +++ b/crates/nu-command/src/debug/profile.rs @@ -106,7 +106,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 } -d 2 --source"#, result: None, }] } diff --git a/crates/nu-command/src/debug/view_source.rs b/crates/nu-command/src/debug/view_source.rs index d9684c107..fbc5f1f4d 100644 --- a/crates/nu-command/src/debug/view_source.rs +++ b/crates/nu-command/src/debug/view_source.rs @@ -166,7 +166,7 @@ impl Command for ViewSource { vec![ Example { description: "View the source of a code block", - example: r#"let abc = { echo 'hi' }; view source $abc"#, + example: r#"let abc = {|| echo 'hi' }; view source $abc"#, result: Some(Value::test_string("{ echo 'hi' }")), }, Example { diff --git a/crates/nu-command/src/filesystem/ls.rs b/crates/nu-command/src/filesystem/ls.rs index 02dc35dde..4ae902859 100644 --- a/crates/nu-command/src/filesystem/ls.rs +++ b/crates/nu-command/src/filesystem/ls.rs @@ -315,7 +315,7 @@ impl Command for Ls { }, Example { description: "List given paths and show directories themselves", - example: "['/path/to/directory' '/path/to/file'] | each { ls -D $in } | flatten", + example: "['/path/to/directory' '/path/to/file'] | each {|| ls -D $in } | flatten", result: None, }, ] diff --git a/crates/nu-command/src/filesystem/watch.rs b/crates/nu-command/src/filesystem/watch.rs index 70b73cffa..0b4c78d89 100644 --- a/crates/nu-command/src/filesystem/watch.rs +++ b/crates/nu-command/src/filesystem/watch.rs @@ -269,7 +269,7 @@ impl Command for Watch { vec![ Example { description: "Run `cargo test` whenever a Rust file changes", - example: r#"watch . --glob=**/*.rs { cargo test }"#, + example: r#"watch . --glob=**/*.rs {|| cargo test }"#, result: None, }, Example { diff --git a/crates/nu-command/src/filters/par_each.rs b/crates/nu-command/src/filters/par_each.rs index 6385bbdff..a21fbee94 100644 --- a/crates/nu-command/src/filters/par_each.rs +++ b/crates/nu-command/src/filters/par_each.rs @@ -47,7 +47,7 @@ impl Command for ParEach { fn examples(&self) -> Vec { vec![ Example { - example: "[1 2 3] | par-each { 2 * $in }", + example: "[1 2 3] | par-each {|| 2 * $in }", description: "Multiplies each number. Note that the list will become arbitrarily disordered.", result: None, diff --git a/crates/nu-command/src/filters/shuffle.rs b/crates/nu-command/src/filters/shuffle.rs index 2795792a7..be77b532c 100644 --- a/crates/nu-command/src/filters/shuffle.rs +++ b/crates/nu-command/src/filters/shuffle.rs @@ -46,7 +46,7 @@ impl Command for Shuffle { fn examples(&self) -> Vec { vec![Example { description: "Shuffle rows randomly (execute it several times and see the difference)", - example: r#"[[version patch]; [1.0.0 false] [3.0.1 true] [2.0.0 false]] | shuffle"#, + example: r#"[[version patch]; ['1.0.0' false] ['3.0.1' true] ['2.0.0' false]] | shuffle"#, result: None, }] } diff --git a/crates/nu-command/src/filters/where_.rs b/crates/nu-command/src/filters/where_.rs index 8144bea01..a34651cc3 100644 --- a/crates/nu-command/src/filters/where_.rs +++ b/crates/nu-command/src/filters/where_.rs @@ -150,7 +150,7 @@ not supported."# }, Example { description: "Find files whose filenames don't begin with the correct sequential number", - example: "ls | where type == file | sort-by name -n | enumerate | where {|e| $e.item.name !~ $'^($e.index + 1)' } | each { get item }", + example: "ls | where type == file | sort-by name -n | enumerate | where {|e| $e.item.name !~ $'^($e.index + 1)' } | each {|| get item }", result: None, }, ] diff --git a/crates/nu-command/src/filters/zip.rs b/crates/nu-command/src/filters/zip.rs index b90a187de..146991745 100644 --- a/crates/nu-command/src/filters/zip.rs +++ b/crates/nu-command/src/filters/zip.rs @@ -77,7 +77,7 @@ impl Command for Zip { }), }, Example { - example: "glob *.ogg | zip ['bang.ogg', 'fanfare.ogg', 'laser.ogg'] | each { mv $in.0 $in.1 }", + example: "glob *.ogg | zip ['bang.ogg', 'fanfare.ogg', 'laser.ogg'] | each {|| mv $in.0 $in.1 }", description: "Rename .ogg files to match an existing list of filenames", result: None, }, diff --git a/crates/nu-command/src/platform/ansi/gradient.rs b/crates/nu-command/src/platform/ansi/gradient.rs index bb8a67dbf..ae341c0ca 100644 --- a/crates/nu-command/src/platform/ansi/gradient.rs +++ b/crates/nu-command/src/platform/ansi/gradient.rs @@ -72,25 +72,25 @@ impl Command for SubCommand { Example { description: "draw text in a gradient with foreground start and end colors", example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff", + "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff'", result: None, }, Example { description: "draw text in a gradient with foreground start and end colors and background start and end colors", example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff --bgstart 0xe81cff --bgend 0x40c9ff", + "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff' --fgend '0xe81cff' --bgstart '0xe81cff' --bgend '0x40c9ff'", result: None, }, Example { description: "draw text in a gradient by specifying foreground start color - end color is assumed to be black", example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff", + "'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart '0x40c9ff'", result: None, }, Example { description: "draw text in a gradient by specifying foreground end color - start color is assumed to be black", example: - "'Hello, Nushell! This is a gradient.' | ansi gradient --fgend 0xe81cff", + "'Hello, Nushell! This is a gradient.' | ansi gradient --fgend '0xe81cff'", result: None, }, ] diff --git a/crates/nu-command/src/viewers/explore.rs b/crates/nu-command/src/viewers/explore.rs index 3eef7a126..65837a123 100644 --- a/crates/nu-command/src/viewers/explore.rs +++ b/crates/nu-command/src/viewers/explore.rs @@ -120,7 +120,7 @@ impl Command for Explore { }, Example { description: "Explore a list of Markdown files' contents, with row indexes", - example: r#"glob *.md | each { open } | explore -i"#, + example: r#"glob *.md | each {|| open } | explore -i"#, result: None, }, Example {