toml

package
v0.0.0-...-345b6a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 12 Imported by: 0

README

toml

output a pretty toml

Usage

$ show toml -h
NAME:
   show toml - toml beautify output

USAGE:
   show toml [command options] [arguments...]

DESCRIPTION:
   display file or remote toml data, you can display the toml data you need by specifying the toml field key,
   if you don’t specify the key, the complete toml data will be displayed
   eg:
   show toml --remote https://raw.githubusercontent.com/anqiansong/show/main/testdata/data.toml data.user
   show toml --file data.toml

OPTIONS:
   --remote value, -r value  show toml from remote
   --file value, -f value    show toml from file
   --help, -h                show help (default: false)
Example
output pretty toml data from remote
$ show toml --remote https://raw.githubusercontent.com/anqiansong/show/main/testdata/data.toml
code = 0
msg = "ok"

[data]

  [data.user]
    company = "ByteDance"
    desc = "none"
    name = "keson"
specified json key
$ show toml --remote https://raw.githubusercontent.com/anqiansong/show/main/testdata/data.toml data.user.name
keson
from file
$ show toml -f data.toml
code = 0
msg = "ok"

[data]

  [data.user]
    company = "ByteDance"
    desc = "none"
    name = "keson"
$ show toml -f data.toml data.user
company = "ByteDance"
desc = "none"
name = "keson"
from linux channel
$ cat data.toml | show toml data
company = "ByteDance"
desc = "none"
name = "keson"
$ cat data.toml | show toml data.user.name
keson

Preview

toml highlight output

  • os: macOS
  • terminal: iTerm
  • theme: atom_bold_italic toml-highlighting

Documentation

Overview

Package toml is used to beautify the output of toml. The toml data can come from files, networks and linux pipelines, such as: show toml --file data.toml data.name means to view the data.name in the data.toml file, show toml- -remote https://raw.githubusercontent.com/anqiansong/show/main/testdata/data.toml data.user.name represents view the name in the data.toml, echo 'name: foo' | show toml name represents view the data which key is name.

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "toml",
	Usage: "toml beautify output",
	Description: "display a file or remote toml data, you can display the toml data you need by specifying the toml field key, \n" +
		"if you don’t specify the key, the complete toml data will be displayed\n" +
		"eg:\n" +
		"show toml --remote https://raw.githubusercontent.com/anqiansong/show/main/testdata/data.toml data.user\n" +
		"show toml --file data.toml",
	Action: actionToml,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "remote",
			Usage:   "show toml from remote",
			Aliases: []string{"r"},
		},
		&cli.StringFlag{
			Name:    "file",
			Usage:   "show toml from file",
			Aliases: []string{"f"},
		},
	},
}

Command describes a subcommands in application.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL