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