mirror of
https://github.com/nushell/nushell.git
synced 2025-04-07 18:55:30 +02:00
Add long options for formats (#10645)
This commit is contained in:
parent
e427c68731
commit
765b303689
@ -62,7 +62,7 @@ impl Command for FromOds {
|
|||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Convert binary .ods data to a table, specifying the tables",
|
description: "Convert binary .ods data to a table, specifying the tables",
|
||||||
example: "open --raw test.ods | from ods -s [Spreadsheet1]",
|
example: "open --raw test.ods | from ods --sheets [Spreadsheet1]",
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -53,7 +53,7 @@ impl Command for FromSsv {
|
|||||||
)),
|
)),
|
||||||
}, Example {
|
}, Example {
|
||||||
example: r#"'FOO BAR
|
example: r#"'FOO BAR
|
||||||
1 2' | from ssv -n"#,
|
1 2' | from ssv --noheaders"#,
|
||||||
description: "Converts ssv formatted string to table but not treating the first row as column names",
|
description: "Converts ssv formatted string to table but not treating the first row as column names",
|
||||||
result: Some(
|
result: Some(
|
||||||
Value::list(
|
Value::list(
|
||||||
|
@ -93,7 +93,7 @@ impl Command for FromTsv {
|
|||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Create a tsv file without header columns and open it",
|
description: "Create a tsv file without header columns and open it",
|
||||||
example: r#"$'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv -n"#,
|
example: r#"$'a1(char tab)b1(char tab)c1(char nl)a2(char tab)b2(char tab)c2' | save tsv-data | open tsv-data | from tsv --noheaders"#,
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
|
@ -62,7 +62,7 @@ impl Command for FromXlsx {
|
|||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Convert binary .xlsx data to a table, specifying the tables",
|
description: "Convert binary .xlsx data to a table, specifying the tables",
|
||||||
example: "open --raw test.xlsx | from xlsx -s [Spreadsheet1]",
|
example: "open --raw test.xlsx | from xlsx --sheets [Spreadsheet1]",
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -44,7 +44,7 @@ impl Command for ToCsv {
|
|||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Outputs an CSV string representing the contents of this table",
|
description: "Outputs an CSV string representing the contents of this table",
|
||||||
example: "[[foo bar]; [1 2]] | to csv -s ';' ",
|
example: "[[foo bar]; [1 2]] | to csv --separator ';' ",
|
||||||
result: Some(Value::test_string("foo;bar\n1;2\n")),
|
result: Some(Value::test_string("foo;bar\n1;2\n")),
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
|
@ -91,7 +91,7 @@ impl Command for ToJson {
|
|||||||
Example {
|
Example {
|
||||||
description:
|
description:
|
||||||
"Outputs a JSON string, with 4-space indentation, representing the contents of this table",
|
"Outputs a JSON string, with 4-space indentation, representing the contents of this table",
|
||||||
example: "[Joe Bob Sam] | to json -i 4",
|
example: "[Joe Bob Sam] | to json --indent 4",
|
||||||
result: Some(Value::test_string("[\n \"Joe\",\n \"Bob\",\n \"Sam\"\n]")),
|
result: Some(Value::test_string("[\n \"Joe\",\n \"Bob\",\n \"Sam\"\n]")),
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
|
@ -60,7 +60,7 @@ Additionally any field which is: empty record, empty list or null, can be omitte
|
|||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Optionally, formats the text with a custom indentation setting",
|
description: "Optionally, formats the text with a custom indentation setting",
|
||||||
example: r#"{tag: note content : [{tag: remember content : [Event]}]} | to xml -p 3"#,
|
example: r#"{tag: note content : [{tag: remember content : [Event]}]} | to xml --pretty 3"#,
|
||||||
result: Some(Value::test_string(
|
result: Some(Value::test_string(
|
||||||
"<note>\n <remember>Event</remember>\n</note>",
|
"<note>\n <remember>Event</remember>\n</note>",
|
||||||
)),
|
)),
|
||||||
|
@ -21,7 +21,7 @@ fn from_ods_file_to_table_select_sheet() {
|
|||||||
cwd: "tests/fixtures/formats", pipeline(
|
cwd: "tests/fixtures/formats", pipeline(
|
||||||
r#"
|
r#"
|
||||||
open sample_data.ods --raw
|
open sample_data.ods --raw
|
||||||
| from ods -s ["SalesOrders"]
|
| from ods --sheets ["SalesOrders"]
|
||||||
| columns
|
| columns
|
||||||
| get 0
|
| get 0
|
||||||
"#
|
"#
|
||||||
|
@ -21,7 +21,7 @@ fn from_excel_file_to_table_select_sheet() {
|
|||||||
cwd: "tests/fixtures/formats", pipeline(
|
cwd: "tests/fixtures/formats", pipeline(
|
||||||
r#"
|
r#"
|
||||||
open sample_data.xlsx --raw
|
open sample_data.xlsx --raw
|
||||||
| from xlsx -s ["SalesOrders"]
|
| from xlsx --sheets ["SalesOrders"]
|
||||||
| columns
|
| columns
|
||||||
| get 0
|
| get 0
|
||||||
"#
|
"#
|
||||||
|
Loading…
Reference in New Issue
Block a user