commands

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Default       string                 `yaml:"default,omitempty"`       // pattern for requests without abbreviations
	Abbreviations map[string]string      `yaml:"abbreviations,omitempty"` // abbreviations, (ex: alias:owner/repo), stored as alias => pattern ({0} as placeholder)
	Values        map[string]interface{} `yaml:"values,omitempty"`        // global default values
	Git           gitMode                `yaml:"git,omitempty"`           // global default (if not defined by flag) git mode: auto (default), native, embedded
}

func LoadConfig

func LoadConfig(file string) (*Config, error)

func (*Config) Save added in v1.3.1

func (cfg *Config) Save(file string) error

type ConfigSource added in v1.3.1

type ConfigSource struct {
	Config string `` /* 129-byte string literal not displayed */
}

type NewCommand

type NewCommand struct {
	ConfigSource
	Version        string  `long:"version" env:"VERSION" description:"Override binary version to bypass manifest restriction"`
	UI             string  `short:"u" long:"ui" env:"UI" description:"UI mode" default:"nice" choice:"nice" choice:"simple"`
	Debug          bool    `short:"d" long:"debug" env:"DEBUG" description:"Enable debug mode"`
	AskOnce        bool    `short:"a" long:"ask-once" env:"ASK_ONCE" description:"Do not retry on wrong user input, good for automation"`
	DisableCleanup bool    `short:"D" long:"disable-cleanup" env:"DISABLE_CLEANUP" description:"Disable removing created dirs in case of failure"`
	Git            gitMode `` /* 144-byte string literal not displayed */
	Args           struct {
		URL  string `positional-arg-name:"source" required:"yes" description:"URL, abbreviation or path to layout"`
		Dest string `positional-arg-name:"destination" required:"yes" description:"Destination directory, will be created"`
	} `positional-args:"yes"`
}

func (NewCommand) Execute

func (cmd NewCommand) Execute([]string) error

type SetCommand added in v1.3.1

type SetCommand struct {
	Git     SetGitCommand     `command:"git" description:"git client mode"`
	Default SetDefaultCommand `command:"default" description:"URL pattern to resolve layout"`
}

func (SetCommand) Execute added in v1.3.1

func (cmd SetCommand) Execute([]string) error

type SetDefaultCommand added in v1.3.1

type SetDefaultCommand struct {
	ConfigSource
	Args struct {
		Pattern string `positional-arg-name:"pattern" required:"yes" description:"Pattern for requests without abbreviations. May contain {0}"`
	} `positional-args:"yes"`
}

func (*SetDefaultCommand) Execute added in v1.3.1

func (sc *SetDefaultCommand) Execute([]string) error

type SetGitCommand added in v1.3.1

type SetGitCommand struct {
	ConfigSource
	Args struct {
		Git gitMode `` /* 142-byte string literal not displayed */
	} `positional-args:"yes"`
}

func (*SetGitCommand) Execute added in v1.3.1

func (sc *SetGitCommand) Execute([]string) error

type ShowCommand

type ShowCommand struct {
	ConfigFile ShowConfigFileCommand `command:"config-file" description:"location of default config file"`
	Config     ShowConfigCommand     `command:"config" description:"current config"`
}

type ShowConfigCommand added in v1.3.1

type ShowConfigCommand struct {
	ConfigSource
}

func (ShowConfigCommand) Execute added in v1.3.1

func (cmd ShowConfigCommand) Execute([]string) error

type ShowConfigFileCommand

type ShowConfigFileCommand struct {
}

func (ShowConfigFileCommand) Execute

func (cmd ShowConfigFileCommand) Execute([]string) error

Jump to

Keyboard shortcuts

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