Skip to content

Commit 440b9c8

Browse files
Fix typo in examples of the table command (#15925)
# Description Currently, the examples for `table` have a small typo (notice row 1, column a): ``` Render data in table view > [[a b]; [1 2] [3 4]] | table ╭───┬───┬───╮ │ # │ a │ b │ ├───┼───┼───┤ │ 0 │ 1 │ 2 │ │ 1 │ 3 │ 4 │ ╰───┴───┴───╯ Render data in table view (expanded) > [[a b]; [1 2] [2 [4 4]]] | table --expand ╭───┬───┬───────────╮ │ # │ a │ b │ ├───┼───┼───────────┤ │ 0 │ 1 │ 2 │ │ 1 │ 3 │ ╭───┬───╮ │ │ │ │ │ 0 │ 4 │ │ │ │ │ │ 1 │ 4 │ │ │ │ │ ╰───┴───╯ │ ╰───┴───┴───────────╯ Render data in table view (collapsed) > [[a b]; [1 2] [2 [4 4]]] | table --collapse ╭───┬───╮ │ a │ b │ ├───┼───┤ │ 1 │ 2 │ ├───┼───┤ │ 3 │ 4 │ │ ├───┤ │ │ 4 │ ╰───┴───╯ ``` I changed the example commands to match their outputs, and swapped the 2 for a 3 in all the following examples too, for consistency. # User-Facing Changes More accurate examples for the `table` command. # Tests + Formatting No changes # After Submitting
1 parent 96a886e commit 440b9c8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

crates/nu-command/src/viewers/table.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Command for Table {
152152
},
153153
Example {
154154
description: "Render data in table view (expanded)",
155-
example: r#"[[a b]; [1 2] [2 [4 4]]] | table --expand"#,
155+
example: r#"[[a b]; [1 2] [3 [4 4]]] | table --expand"#,
156156
result: Some(Value::test_list(vec![
157157
Value::test_record(record! {
158158
"a" => Value::test_int(1),
@@ -169,7 +169,7 @@ impl Command for Table {
169169
},
170170
Example {
171171
description: "Render data in table view (collapsed)",
172-
example: r#"[[a b]; [1 2] [2 [4 4]]] | table --collapse"#,
172+
example: r#"[[a b]; [1 2] [3 [4 4]]] | table --collapse"#,
173173
result: Some(Value::test_list(vec![
174174
Value::test_record(record! {
175175
"a" => Value::test_int(1),
@@ -186,22 +186,22 @@ impl Command for Table {
186186
},
187187
Example {
188188
description: "Change the table theme to the specified theme for a single run",
189-
example: r#"[[a b]; [1 2] [2 [4 4]]] | table --theme basic"#,
189+
example: r#"[[a b]; [1 2] [3 [4 4]]] | table --theme basic"#,
190190
result: None,
191191
},
192192
Example {
193193
description: "Force showing of the #/index column for a single run",
194-
example: r#"[[a b]; [1 2] [2 [4 4]]] | table -i true"#,
194+
example: r#"[[a b]; [1 2] [3 [4 4]]] | table -i true"#,
195195
result: None,
196196
},
197197
Example {
198198
description: "Set the starting number of the #/index column to 100 for a single run",
199-
example: r#"[[a b]; [1 2] [2 [4 4]]] | table -i 100"#,
199+
example: r#"[[a b]; [1 2] [3 [4 4]]] | table -i 100"#,
200200
result: None,
201201
},
202202
Example {
203203
description: "Force hiding of the #/index column for a single run",
204-
example: r#"[[a b]; [1 2] [2 [4 4]]] | table -i false"#,
204+
example: r#"[[a b]; [1 2] [3 [4 4]]] | table -i false"#,
205205
result: None,
206206
},
207207
]

0 commit comments

Comments
 (0)