cli

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cli initializes cobra commands by parsing yaml files.

Index

Constants

This section is empty.

Variables

View Source
var ExampleCmd = &cobra.Command{
	Use:   "example",
	Short: "Makes a demo oneterminal config in ~/.config/oneterminal",
	Run: func(cmd *cobra.Command, args []string) {
		if err := yaml.WriteExampleConfig("example.yml"); err != nil {
			panic(fmt.Sprintf("Error generating example config :( %s", err))
		}
		fmt.Println("Example file generated at ~/.config/oneterminal/example.yml")
	},
}

ExampleCmd makes an example oneterminal config file in the ~/.config/oneterminal directory

Functions

func Init added in v0.3.3

func Init(version string) (*cobra.Command, error)

Init creates the root command by parsing all yaml configs from the ~/.config/oneterminal directory and adding them to the root command.

All commands will be accessible via oneterminal <command-name>

Types

This section is empty.

Jump to

Keyboard shortcuts

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