cmd

package
v0.0.0-...-b270532 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditFile

func EditFile(f string) error

EditFile opens the specified in an editor, respecting $EDITOR if it is set, otherwise using vim

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetConfigVariables

func GetConfigVariables() map[string]string

GetConfigVariables gets the variables set in the configuration file

func GetProfiles

func GetProfiles() ([]string, error)

GetProfiles returns a list of all the profiles

func GetTemplates

func GetTemplates() ([]string, error)

GetTemplates returns a list of all the templates in the current profile

func SaveVariables

func SaveVariables() error

SaveVariables saves the variables the config file, respecting case

Types

type Template

type Template struct {
	Line      string            `json:"line"`
	Variables map[string]string `json:"variables"`
	Defaults  map[string]string `json:"defaults"`
}

func GetTemplate

func GetTemplate(t string) (*Template, error)

GetTemplate returns a Template object loaded using the specified template

type VariablesConfig

type VariablesConfig struct {
	Variables map[string]string `json:"variables"`
}

Jump to

Keyboard shortcuts

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