Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BashCompletion ¶
func BashCompletion(cmd *cobra.Command, flags *pflag.FlagSet, flag string, fname, fbody string) error
BashCompletion annotates the flag with completion function and registers the completion function in the root command if it hasn't been added already.
func NewBackgroundSpinner ¶
func NewBackgroundSpinner(description string, refresh time.Duration) context.CancelFunc
NewBackgroundSpinner creates a new spinner which runs in background refreshing its output on a constant rate. The spinner is prefixed with the provided description. Returns a function which cancels the spinner. The default value for refresh is used if provided refresh is less than or equal to zero.
func WithDefaultPort ¶
WithDefaultPort adds a default port if no port is present.
Types ¶
type NamedRegex ¶
NamedRegex is a regex which supports named capture groups.
func MustCompile ¶
func MustCompile(s string) NamedRegex
MustCompile compiles a string to a named regexp.
func (*NamedRegex) FindStringSubmatchMap ¶
func (r *NamedRegex) FindStringSubmatchMap(s string) map[string]string
FindStringSubmatchMap returns a map of named capture groups.