cobracompletefig

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 4 Imported by: 50

README

Fig // Cobra CLI

This Go package is Fig's integration with popular CLI framework Cobra.

See Fig's docs for how to integrate: https://fig.io/docs/guides/autocomplete-for-teams/cobra

Contributors

This integration was built by Ethan Orlander. Please see his repo for the original docs, git history, and additional customization information: https://github.com/EthanOrlander/genFigSpec.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCompletionSpecCommand

func CreateCompletionSpecCommand(options ...Opts) *cobra.Command

Types

type Arg

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

func (*Arg) ToTypescript

func (arg *Arg) ToTypescript() string

type Args

type Args []Arg

func (*Args) ToTypescript

func (args *Args) ToTypescript() string

type BaseSuggestion

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

type Names

type Names []string

func (*Names) ToTypescript

func (names *Names) ToTypescript() string

type Option

type Option struct {
	*BaseSuggestion
	// contains filtered or unexported fields
}

func (*Option) ToTypescript

func (option *Option) ToTypescript() string

type Options

type Options []Option

func (*Options) ToTypescript

func (options *Options) ToTypescript() string

type Opts

type Opts struct {
	Use     string
	Short   string
	Visible bool
	Long    string
	// contains filtered or unexported fields
}

type Spec

type Spec struct {
	*Subcommand
	// contains filtered or unexported fields
}

func GenerateCompletionSpec

func GenerateCompletionSpec(root *cobra.Command) Spec

func (*Spec) ToTypescript

func (spec *Spec) ToTypescript() string

type Subcommand

type Subcommand struct {
	*BaseSuggestion
	// contains filtered or unexported fields
}

func (*Subcommand) ToTypescript

func (subcommand *Subcommand) ToTypescript() string

type Subcommands

type Subcommands []Subcommand

func (*Subcommands) ToTypescript

func (subcommands *Subcommands) ToTypescript() string

type Suggestion

type Suggestion struct {
	*BaseSuggestion
	// contains filtered or unexported fields
}

type SuggestionType

type SuggestionType int
const (
	FOLDER SuggestionType = iota
	FILE
	ARG
	SUBCOMMAND
	OPTION
	SPECIAL
	SHORTCUT
)

type Template

type Template int
const (
	FOLDERS Template = iota
	FILEPATHS
)

Jump to

Keyboard shortcuts

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