cmd

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: CC0-1.0 Imports: 45 Imported by: 12

Documentation

Overview

This file contains common functions that are shared in the lab package

Index

Constants

This section is empty.

Variables

View Source
var (
	CommandPrefix string
)
View Source
var RootCmd = &cobra.Command{
	Use:   "lab",
	Short: "lab: A GitLab Command Line Interface Utility",
	Long:  ``,
	Run: func(cmd *cobra.Command, args []string) {
		if ok, err := cmd.Flags().GetBool("version"); err == nil && ok {
			versionCmd.Run(cmd, args)
			return
		}
		helpCmd.Run(cmd, args)
	},
}

RootCmd represents the base command when called without any subcommands

View Source
var Version string

Version is set with linker flags during build.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func LabPersistentPreRun added in v0.21.0

func LabPersistentPreRun(cmd *cobra.Command, args []string)

func MapLabels added in v0.21.0

func MapLabels(rn string, labelTerms []string) ([]string, error)

func NoteRunFn added in v0.21.0

func NoteRunFn(cmd *cobra.Command, args []string)

Types

type Pager added in v0.21.0

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

func NewPager added in v0.21.0

func NewPager(fs *flag.FlagSet) *Pager

If standard output is a terminal, redirect output to an external pager until the returned object's Close() method is called

func (*Pager) Close added in v0.21.0

func (pager *Pager) Close()

Jump to

Keyboard shortcuts

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