nushell/docs/commands/from-toml.md
Jörn Zaefferer 8ab2b92405
docs/commands: add from.md, update subcommands (#1712)
This adds a top-level document for the new `from` command, with a list of links of all the subcommands.

All the from-* subcommands keep their filename, but the content is updated to use the new subcommand syntax.

Needs matching update for to*

Ref #1709
2020-05-05 09:01:31 +12:00

1.2 KiB

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 :

> 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 :

> open Cargo.lock | from toml
━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━
 metadata       │ package
────────────────┼───────────────────
 [table: 1 row][table: 154 rows]
━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━