mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Update docs for open and decode command, regenerate all docs (#4815)
* Update docs for open and decode command, regenerate all docs * Update open.rs * Update open.md Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
This commit is contained in:
@ -20,7 +20,7 @@ impl Command for Open {
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
"Opens a file."
|
||||
"Load a file into a cell, converting to table if possible (avoid by appending '--raw')."
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
@ -172,6 +172,11 @@ impl Command for Open {
|
||||
example: "echo 'myfile.txt' | open",
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Open a file, and decode it by the specified encoding",
|
||||
example: "open myfile.txt --raw | decode utf-8",
|
||||
result: None,
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,14 @@ impl Command for Decode {
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
||||
fn extra_usage(&self) -> &str {
|
||||
r#"Multiple encodings are supported, here is an example of a few:
|
||||
big5, euc-jp, euc-kr, gbk, iso-8859-1, utf-16, cp1252, latin5
|
||||
|
||||
For a more complete list of encodings please refer to the encoding_rs
|
||||
documentation link at https://docs.rs/encoding_rs/0.8.28/encoding_rs/#statics"#
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![Example {
|
||||
description: "Decode the output of an external command",
|
||||
|
Reference in New Issue
Block a user