flags

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ColorNever = "never"

Variables

View Source
var (
	Memory = &cli.StringFlag{
		Name:    "memory",
		Aliases: []string{"me"},
		Usage:   "Max memory either in form 10GB or 10",
	}

	MemoryUnit = &cli.StringFlag{
		Name:    "memory-unit",
		Aliases: []string{"mu"},
		Usage:   "Unit if not provided with memory; " + UsageOneOfOption(common.SizeUnitTypes),
	}
)
View Source
var (
	Size = &cli.StringFlag{
		Name:    "size",
		Aliases: []string{"s"},
		Usage:   "Max size either in form 10GB or 10",
	}

	SizeUnit = &cli.StringFlag{
		Name:    "size-unit",
		Aliases: []string{"su"},
		Usage:   "Unit if not provided with size; " + UsageOneOfOption(common.SizeUnitTypes),
	}
)
View Source
var Branch = &cli.StringFlag{
	Name:    "branch",
	Aliases: []string{"b"},
}
View Source
var Call = &cli.StringFlag{
	Name:    "call",
	Aliases: []string{"ca"},
	Usage:   "Exported function to call",
}
View Source
var Clone = &BoolWithInverseFlag{
	BoolFlag: &cli.BoolFlag{
		Name:  "clone",
		Usage: "Clone an attached repository (Unused for generated repositories)",
	},
}
View Source
var Color = &cli.StringFlag{
	Name:        "color",
	DefaultText: "auto",
	EnvVars:     []string{"TAU_COLOR"},
}
View Source
var ColorOptions = []string{"never", "auto"}
View Source
var (
	CommitMessage = &cli.StringFlag{
		Name:    "message",
		Aliases: []string{"m"},
		Usage:   "Commit message for a git commit",
	}
)
View Source
var (
	DefaultInverseBoolPrefix = "no-"
)
View Source
var Description = &cli.StringFlag{
	Name:    "description",
	Aliases: []string{"d"},
}
View Source
var Domains = &cli.StringSliceFlag{
	Name:  "domains",
	Usage: "List of domains (comma, separated) by name or FQDN",
}
View Source
var EmbedToken = &BoolWithInverseFlag{
	BoolFlag: &cli.BoolFlag{
		Name:    "embed-token",
		Aliases: []string{"e"},
		Usage:   "Embed git token into remote url",
	},
}
View Source
var EntryPoint = &cli.StringFlag{
	Name:    "entry-point",
	Aliases: []string{"ep"},
}
View Source
var Env = &cli.BoolFlag{
	Name:    "env",
	EnvVars: []string{"TAU_ENV"},
}
View Source
var GenerateRepo = &BoolWithInverseFlag{
	BoolFlag: &cli.BoolFlag{
		Name:    "generate-repository",
		Aliases: []string{"g"},
		Usage:   "Create a new repository on your selected git provider",
	},
}
View Source
var Language = &cli.StringFlag{
	Name:    "language",
	Aliases: []string{"lang"},
	Usage:   "Template language; " + UsageOneOfOption(common.GetLanguages()),
}
View Source
var List = &cli.BoolFlag{
	Name: "list",
}
View Source
var Local = &BoolWithInverseFlag{
	BoolFlag: &cli.BoolFlag{
		Name:    "local",
		Aliases: []string{"l"},
	},
}
View Source
var Match = &cli.StringFlag{
	Name:    "match",
	Aliases: []string{"m"},
	Usage:   "[^regex] if configured or /path/to/match",
}
View Source
var MatchRegex = &BoolWithInverseFlag{
	BoolFlag: &cli.BoolFlag{
		Name:    "regex",
		Aliases: []string{"r"},
		Usage:   "Match using regex",
	},
}
View Source
var Name = &cli.StringFlag{
	Name:    "name",
	Aliases: []string{"n"},
}
View Source
var Path = &cli.StringFlag{
	Name:    "path",
	Aliases: []string{"p"},
}
View Source
var Paths = &cli.StringSliceFlag{
	Name:    "paths",
	Aliases: []string{"p"},
	Usage:   "HTTP paths to use for the endpoint",
}
View Source
var Private = &BoolWithInverseFlag{
	BoolFlag: &cli.BoolFlag{
		Name:  "private",
		Usage: "Visibility of the generated repository",
	},
}
View Source
var Provider = &cli.StringFlag{
	Name:        "provider",
	DefaultText: "github",
	Usage:       "Git provider",
}
View Source
var RepositoryId = &cli.StringFlag{
	Name:    "repository-id",
	Aliases: []string{"repo-id"},
	Usage:   "Repository ID to use",
}
View Source
var RepositoryName = &cli.StringFlag{
	Name:    "repository-name",
	Aliases: []string{"repo-n"},
	Usage:   "Name of a repository with current user or user/name full name of a repository",
}
View Source
var Select = &cli.BoolFlag{
	Name:  "select",
	Usage: "Ignore current and trigger a selection prompt",
}
View Source
var Source = &cli.StringFlag{
	Name:  "source",
	Usage: "Path within the code folder or a library repository ex: . | libraries/<library>",
}
View Source
var Tags = &cli.StringSliceFlag{
	Name:    "tags",
	Aliases: []string{"t"},
}
View Source
var Template = &cli.StringFlag{
	Name:  "template",
	Usage: "See: " + templates.TemplateRepoURL,
}
View Source
var Timeout = &cli.StringFlag{
	Name:    "timeout",
	Aliases: []string{"ttl"},
	Usage:   "Time to live for an instance",
}
View Source
var UseCodeTemplate = &BoolWithInverseFlag{
	BoolFlag: &cli.BoolFlag{
		Name: "use-template",
	},
}
View Source
var Yes = &cli.BoolFlag{
	Name:    "yes",
	Aliases: []string{"y"},
	Usage:   "Skip the confirmation prompt",
}

Functions

func Combine

func Combine(flags ...interface{}) []cli.Flag

func GeneratedRepoUsage

func GeneratedRepoUsage(format string) string

func GetColor

func GetColor(c *cli.Context) (color string, err error)

func ToUpper

func ToUpper(c *cli.Context, flags ...*cli.StringFlag)

ToUpper takes a slice of StringFlag sets the values each flag to upper case if the flag is set

func UsageOneOfOption

func UsageOneOfOption(options []string) string

Types

type BoolWithInverse

type BoolWithInverse interface {
	Value(ctx *cli.Context) bool
	IsSet(ctx *cli.Context) bool
}

type BoolWithInverseFlag

type BoolWithInverseFlag struct {
	// The BoolFlag which the positive and negative flags are generated from
	*cli.BoolFlag

	// The prefix used to indicate a negative value
	// Default: `env` becomes `no-env`
	InversePrefix string
	// contains filtered or unexported fields
}

func (*BoolWithInverseFlag) Apply

func (s *BoolWithInverseFlag) Apply(set *flag.FlagSet) error

func (*BoolWithInverseFlag) Flags

func (s *BoolWithInverseFlag) Flags() []cli.Flag

func (*BoolWithInverseFlag) IsSet

func (s *BoolWithInverseFlag) IsSet() bool

func (*BoolWithInverseFlag) Names

func (s *BoolWithInverseFlag) Names() []string

func (*BoolWithInverseFlag) RunAction

func (s *BoolWithInverseFlag) RunAction(ctx *cli.Context) error

func (*BoolWithInverseFlag) String

func (s *BoolWithInverseFlag) String() string

Example for BoolFlag{Name: "env"} --env | --no-env Usage...

func (*BoolWithInverseFlag) Value

func (s *BoolWithInverseFlag) Value() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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