From 07ceec3e0b4721dc04711277ba86d7085020ccfb Mon Sep 17 00:00:00 2001 From: Paul Delafosse Date: Fri, 25 Oct 2019 20:38:55 +0200 Subject: [PATCH] Create docs for from-toml command Partial fix of issue nushell#711 --- docs/commands/from-toml.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs/commands/from-toml.md diff --git a/docs/commands/from-toml.md b/docs/commands/from-toml.md new file mode 100644 index 000000000..d3f3364c7 --- /dev/null +++ b/docs/commands/from-toml.md @@ -0,0 +1,23 @@ +# from-toml +Converts toml data into table. Use this when nushell cannot dertermine the input file extension. + +## Example +Let's say we have the following Rust .lock file : +```shell +> open Cargo.lock +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "adler32" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +... +``` + +The "Cargo.lock" file is actually a .toml file, but the file extension isn't .toml. That's okay, we can use the `from-toml` command : + + +```shell +> open Cargo.lock | from-toml +━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━ + metadata │ package +────────────────┼─────────────────── + [table: 1 row] │ [table: 154 rows] +━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━ +``` \ No newline at end of file