cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var GlobalFlags struct {
	Debug        bool
	Backend      string
	PromptDriver string
	KeychainName string
	PassDir      string
	PassCmd      string
	PassPrefix   string
}

Functions

func AddCommand

func AddCommand(app *kingpin.Application, input AddCommandInput)

func ConfigureAddCommand

func ConfigureAddCommand(app *kingpin.Application)

func ConfigureEditCommand

func ConfigureEditCommand(app *kingpin.Application)

func ConfigureExecCommand

func ConfigureExecCommand(app *kingpin.Application)

func ConfigureGlobals

func ConfigureGlobals(app *kingpin.Application)

func ConfigureListCommand

func ConfigureListCommand(app *kingpin.Application)

func ConfigureRemoveCommand

func ConfigureRemoveCommand(app *kingpin.Application)

func EditCommand

func EditCommand(app *kingpin.Application, input EditCommandInput)

func ExecCommand

func ExecCommand(app *kingpin.Application, input ExecCommandInput)
Example
keyringImpl = keyring.NewArrayKeyring([]keyring.Item{
	{Key: "llamas", Data: []byte(`{"ENV_VAR1":"ABC","ENV_VAR2":"XYZ"}`)},
})

app := kingpin.New("env-vault", "")
ConfigureGlobals(app)
ConfigureExecCommand(app)
kingpin.MustParse(app.Parse([]string{
	"--debug", "exec", "llamas", "--", "sh", "-c", "echo $ENV_VAR1",
}))
Output:

ABC

func LsCommand

func LsCommand(app *kingpin.Application, input LsCommandInput)
Example
keyringImpl = keyring.NewArrayKeyring([]keyring.Item{
	{Key: "llamas", Data: []byte(`{"ENV_VAR1":"ABC","ENV_VAR2":"XYZ"}`)},
})

app := kingpin.New(`env-vault`, ``)
ConfigureGlobals(app)
ConfigureListCommand(app)
kingpin.MustParse(app.Parse([]string{
	"list",
}))
Output:

llamas

func RemoveCommand

func RemoveCommand(app *kingpin.Application, input RemoveCommandInput)

Types

type AddCommandInput

type AddCommandInput struct {
	Profile string
	Keyring keyring.Keyring
}

type EditCommandInput

type EditCommandInput struct {
	Profile string
	Keyring keyring.Keyring
}

type ExecCommandInput

type ExecCommandInput struct {
	Profile string
	Command string
	Args    []string
	Keyring keyring.Keyring
	Signals chan os.Signal
}

type LsCommandInput

type LsCommandInput struct {
	Keyring keyring.Keyring
}

type RemoveCommandInput

type RemoveCommandInput struct {
	Profile string
	Keyring keyring.Keyring
}

Jump to

Keyboard shortcuts

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