cmdutil

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MPL-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmdutil provides utilities for working with cobra commands

Index

Constants

View Source
const (
	SpinnerInterval = 100 * time.Millisecond
	SpinnerColor    = "green"
)

Variables

View Source
var (
	SpinnerCharSet = spinner.CharSets[78]
	SuccessIcon    = color.GreenString("✔")
)

Functions

func DisableAuthCheck

func DisableAuthCheck(cmd *cobra.Command)

func IsAuthCheckEnabled

func IsAuthCheckEnabled(cmd *cobra.Command) bool

Types

type Factory

type Factory struct {
	Log         *zap.SugaredLogger // logger
	Printer     printer.Printer    // printer
	Config      config.Config      // config(flag, env, file)
	ApiClient   api.Client         // query api
	AuthClient  auth.Client        // login, refresh token
	Prompter    prompt.Prompter    // interactive prompter
	Selector    selector.Selector  // interactive selector
	ParamFiller fill.ParamFiller   // fill params
	PersistentFlags
}

Factory is a factory for command runners It is used to pass common dependencies to commands. It is kind of like a "context" for commands.

func NewFactory

func NewFactory() *Factory

NewFactory returns a new cmd factory

func (*Factory) LoggedIn

func (f *Factory) LoggedIn() bool

type PersistentFlags

type PersistentFlags struct {
	Debug            bool // debug mode, default false
	Interactive      bool // interactive mode, default true
	AutoRefreshToken bool // auto refresh token, default true, only when token is from browser(OAuth2)
	AutoCheckUpdate  bool // auto check update, default true
	JSON             bool // output in JSON format, default false
}

PersistentFlags are flags that are common to all commands

Jump to

Keyboard shortcuts

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