Documentation ¶
Index ¶
- Constants
- Variables
- func Comp(actions ...CompAction) ...
- func Delete(name, path string) error
- func Edit(path, defaultContent, name string, validate func(s string) error) error
- func Register[Flags, Data any](app *Command[Flags, Data]) *cobra.Command
- func Root(cmd *cobra.Command)
- type Command
- type CompAction
- type CompResult
- func CompBuilder(_ []string) (*CompResult, error)
- func CompGitRemote(_ []string) (*CompResult, error)
- func CompGitRemoteBranch(_ []string) (*CompResult, error)
- func CompGitTag(_ []string) (*CompResult, error)
- func CompGroup(args []string) (*CompResult, error)
- func CompJob(_ []string) (*CompResult, error)
- func CompRemote(_ []string) (*CompResult, error)
- func CompRepo(args []string) (*CompResult, error)
- func CompTemplate(_ []string) (*CompResult, error)
- func CompWorkflow(_ []string) (*CompResult, error)
- type Context
- type Empty
- type InitFunction
- type PrepareFunction
- type RunFunction
Constants ¶
View Source
const CompNoSpaceFlag = cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp
Variables ¶
View Source
var EmptyCompResult = &CompResult{ Flag: cobra.ShellCompDirectiveNoFileComp, }
Functions ¶
func Comp ¶
func Comp(actions ...CompAction) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
Types ¶
type Command ¶
type Command[Flags, Data any] struct { Use string Desc string Action string Prepare PrepareFunction[Flags] PrepareNoFlag func(cmd *cobra.Command) Init InitFunction[Flags, Data] Run RunFunction[Flags, Data] RunNoContext func() error }
type CompAction ¶
type CompAction func(args []string) (*CompResult, error)
func CompGitLocalBranch ¶
func CompGitLocalBranch(current bool) CompAction
type CompResult ¶
type CompResult struct { Items []string Flag cobra.ShellCompDirective }
func CompBuilder ¶ added in v0.2.0
func CompBuilder(_ []string) (*CompResult, error)
func CompGitRemote ¶
func CompGitRemote(_ []string) (*CompResult, error)
func CompGitRemoteBranch ¶
func CompGitRemoteBranch(_ []string) (*CompResult, error)
func CompGitTag ¶
func CompGitTag(_ []string) (*CompResult, error)
func CompGroup ¶
func CompGroup(args []string) (*CompResult, error)
func CompJob ¶ added in v0.2.0
func CompJob(_ []string) (*CompResult, error)
func CompRemote ¶
func CompRemote(_ []string) (*CompResult, error)
func CompRepo ¶
func CompRepo(args []string) (*CompResult, error)
func CompTemplate ¶ added in v0.5.0
func CompTemplate(_ []string) (*CompResult, error)
func CompWorkflow ¶ added in v0.2.0
func CompWorkflow(_ []string) (*CompResult, error)
type Context ¶
type Context[Flags, Data any] struct { Flags *Flags Data *Data // contains filtered or unexported fields }
func (*Context[Flags, Data]) ArgDefault ¶
type InitFunction ¶
type PrepareFunction ¶
type RunFunction ¶
Click to show internal directories.
Click to hide internal directories.