jsoncmd

package
v0.0.0-...-9c55465 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var YamlCheckCmd = &gcli.Command{
	Name:    "check",
	Aliases: []string{"validate"},
	Desc:    "validate YAML contents format",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errorx.New("TODO")
	},
}

YamlCheckCmd instance

View Source
var YamlToJSONCmd = &gcli.Command{
	Name:    "json",
	Aliases: []string{"to-json"},
	Desc:    "convert create table SQL to markdown table",
	Config: func(c *gcli.Command) {
		c.AddArg("yaml", "input yaml contents for convert")
	},
	Func: func(c *gcli.Command, _ []string) error {
		src, err := apputil.ReadSource(c.Arg("yaml").String())
		if err != nil {
			return err
		}

		bs, err := yaml.YAMLToJSON([]byte(src))
		if err != nil {
			return err
		}

		fmt.Println(string(bs))
		return nil
	},
}

YamlToJSONCmd instance

View Source
var YamlToolCmd = &gcli.Command{
	Name: "yaml",
	Desc: "yaml format contents tool commands",
	Subs: []*gcli.Command{
		YamlViewCmd,
		YamlCheckCmd,
		YamlToJSONCmd,
	},
}

YamlToolCmd instance

View Source
var YamlViewCmd = &gcli.Command{
	Name:    "view",
	Aliases: []string{"cat", "fmt"},
	Desc:    "convert create table SQL to markdown table",
	Config: func(c *gcli.Command) {

	},
	Func: func(c *gcli.Command, _ []string) error {
		return errorx.New("TODO")
	},
}

YamlViewCmd instance

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