cli

package
v0.0.0-...-0fefa07 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName     = "encval"
	ConfigFile  = "config.toml"
	Description = "Inline value encryption utility"
)

Variables

This section is empty.

Functions

func ExitIfErr

func ExitIfErr(err error)

func LocalConfigFiles

func LocalConfigFiles() []string

func SystemConfigFile

func SystemConfigFile() string

func TOML

func TOML(r io.Reader) (kong.Resolver, error)

func UserConfigFile

func UserConfigFile() string

Types

type Cli

type Cli struct {
	// contains filtered or unexported fields
}

func New

func New() (*Cli, error)

func (*Cli) Context

func (c *Cli) Context() *cmd.GlobalOptions

func (*Cli) ExitIfErr

func (c *Cli) ExitIfErr(err error, showUsage bool)

func (*Cli) Parse

func (c *Cli) Parse() (*kong.Context, error)

type ConfigPaths

type ConfigPaths []string

func NewConfigPaths

func NewConfigPaths() ConfigPaths

func (ConfigPaths) Directory

func (c ConfigPaths) Directory() string

Directory tries to find the first existing directory in the lookup path. it works similar to the resolver logic behind kong.ConfigFlag, with the difference, that instead of an empty string, it yields the first item (unless the lookup path is empty, in which case an empty string is also returned)

type Root

type Root struct {
	*cmd.GlobalOptions

	CreateKeys *cmd.CreateKeys `kong:"cmd,help='Create a set of keys with which to encrypt/decrypt data',aliases='init,createkeys,generate-secrets'"`
	Decrypt    *cmd.Decrypt    `kong:"cmd,help='Decrypt some data',aliases='decipher,decode'"`
	Edit       *cmd.Edit       `kong:"cmd,help='Edit an encrypted file',aliases='open'"`
	Encrypt    *cmd.Encrypt    `kong:"cmd,help='Encrypt some data',aliases='encipher,encode'"`
	Password   *cmd.Password   `kong:"cmd,help='Encrypt a password entered on the terminal',aliases='pass,prompt'"`
	Recrypt    *cmd.Recrypt    `kong:"cmd,help='Recrypt some data',aliases='recipher,recode'"`
	Version    *cmd.Version    `kong:"cmd,help='Show version information'"`
}

func NewRoot

func NewRoot(appName string, cfgs ConfigPaths, plugins kong.Plugins) *Root

func (*Root) CliGroups

func (r *Root) CliGroups() []kong.Group

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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