mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 16:33:37 +01:00
Fix newly added examples. (#1830)
This commit is contained in:
parent
acf13a6fcf
commit
5f1136dcb0
@ -44,10 +44,11 @@ impl WholeStreamCommand for Open {
|
|||||||
open(args, registry)
|
open(args, registry)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> &[Example] {
|
fn examples(&self) -> Vec<Example> {
|
||||||
&[Example {
|
vec![Example {
|
||||||
description: "Opens \"users.csv\" and creates a table from the data",
|
description: "Opens \"users.csv\" and creates a table from the data",
|
||||||
example: "open users.csv",
|
example: "open users.csv",
|
||||||
|
result: None,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,10 +33,11 @@ impl WholeStreamCommand for Reject {
|
|||||||
reject(args, registry)
|
reject(args, registry)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> &[Example] {
|
fn examples(&self) -> Vec<Example> {
|
||||||
&[Example {
|
vec![Example {
|
||||||
description: "Lists the files in a directory without showing the modified column",
|
description: "Lists the files in a directory without showing the modified column",
|
||||||
example: "ls | reject modified",
|
example: "ls | reject modified",
|
||||||
|
result: None,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,10 +35,11 @@ impl WholeStreamCommand for Touch {
|
|||||||
touch(args, registry)
|
touch(args, registry)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> &[Example] {
|
fn examples(&self) -> Vec<Example> {
|
||||||
&[Example {
|
vec![Example {
|
||||||
description: "Creates \"fixture.json\"",
|
description: "Creates \"fixture.json\"",
|
||||||
example: "touch fixture.json",
|
example: "touch fixture.json",
|
||||||
|
result: None,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,11 @@ impl WholeStreamCommand for Trim {
|
|||||||
trim(args, registry)
|
trim(args, registry)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> &[Example] {
|
fn examples(&self) -> Vec<Example> {
|
||||||
&[Example {
|
vec![Example {
|
||||||
description: "Trims surrounding whitespace and outputs \"Hello world\"",
|
description: "Trims surrounding whitespace and outputs \"Hello world\"",
|
||||||
example: "echo \" Hello world\" | trim",
|
example: "echo \" Hello world\" | trim",
|
||||||
|
result: Some(vec![Value::from("Hello world")]),
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,11 @@ impl WholeStreamCommand for Version {
|
|||||||
version(args, registry)
|
version(args, registry)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> &[Example] {
|
fn examples(&self) -> Vec<Example> {
|
||||||
&[Example {
|
vec![Example {
|
||||||
description: "Display Nu version",
|
description: "Display Nu version",
|
||||||
example: "version",
|
example: "version",
|
||||||
|
result: None,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,23 +37,27 @@ impl WholeStreamCommand for Where {
|
|||||||
where_command(args, registry)
|
where_command(args, registry)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> &[Example] {
|
fn examples(&self) -> Vec<Example> {
|
||||||
&[
|
vec![
|
||||||
Example {
|
Example {
|
||||||
description: "List all files in the current directory with sizes greater than 2kb",
|
description: "List all files in the current directory with sizes greater than 2kb",
|
||||||
example: "ls | where size > 2kb",
|
example: "ls | where size > 2kb",
|
||||||
|
result: None,
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "List only the files in the current directory",
|
description: "List only the files in the current directory",
|
||||||
example: "ls | where type == File",
|
example: "ls | where type == File",
|
||||||
|
result: None,
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "List all files with names that contain \"Car\"",
|
description: "List all files with names that contain \"Car\"",
|
||||||
example: "ls | where name =~ \"Car\"",
|
example: "ls | where name =~ \"Car\"",
|
||||||
|
result: None,
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "List all files that were modified in the last two months",
|
description: "List all files that were modified in the last two months",
|
||||||
example: "ls | where modified <= 2M",
|
example: "ls | where modified <= 2M",
|
||||||
|
result: None,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user