Add subcommands. Switch from-* and to-* to them (#1708)

This commit is contained in:
Jonathan Turner
2020-05-04 20:44:33 +12:00
committed by GitHub
parent 453087248a
commit a9968046ed
64 changed files with 278 additions and 152 deletions

View File

@@ -8,8 +8,8 @@ fn table_to_json_text_and_from_json_text_back_into_table() {
cwd: "tests/fixtures/formats", pipeline(
r#"
open sgml_description.json
| to-json
| from-json
| to json
| from json
| get glossary.GlossDiv.GlossList.GlossEntry.GlossSee
| echo $it
"#
@@ -37,7 +37,7 @@ fn from_json_text_to_table() {
let actual = nu!(
cwd: dirs.test(),
"open katz.txt | from-json | get katz | get rusty_luck | count | echo $it"
"open katz.txt | from json | get katz | get rusty_luck | count | echo $it"
);
assert_eq!(actual, "4");
@@ -61,7 +61,7 @@ fn from_json_text_recognizing_objects_independently_to_table() {
cwd: dirs.test(), pipeline(
r#"
open katz.txt
| from-json -o
| from json -o
| where name == "GorbyPuff"
| get rusty_luck
| echo $it
@@ -90,8 +90,8 @@ fn table_to_json_text() {
| lines
| split-column "," name luck
| pick name
| to-json
| from-json
| to json
| from json
| nth 0
| get name
| echo $it