mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 00:43:33 +01:00
Improve internal documentation of save
command (#5704)
- Example for `--append` mode. - Search terms for redirection
This commit is contained in:
parent
7a9bf06005
commit
a75318d7e8
@ -20,7 +20,16 @@ impl Command for Save {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["save", "write", "write_file"]
|
||||
vec![
|
||||
"write",
|
||||
"write_file",
|
||||
"append",
|
||||
"redirection",
|
||||
"file",
|
||||
"io",
|
||||
">",
|
||||
">>",
|
||||
]
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
@ -214,12 +223,17 @@ impl Command for Save {
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![
|
||||
Example {
|
||||
description: "Save a string to foo.txt in current directory",
|
||||
description: "Save a string to foo.txt in the current directory",
|
||||
example: r#"echo 'save me' | save foo.txt"#,
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Save a record to foo.json in current directory",
|
||||
description: "Append a string to the end of foo.txt",
|
||||
example: r#"echo 'append me' | save --append foo.txt"#,
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Save a record to foo.json in the current directory",
|
||||
example: r#"echo { a: 1, b: 2 } | save foo.json"#,
|
||||
result: None,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user