cmd

package
v0.0.0-...-c945106 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DEBUG is debug log level
	DEBUG = 2
	// INFO is info log level
	INFO = 1
	// NONE is no logging
	NONE = 0
)

Variables

This section is empty.

Functions

func CheckArgs

func CheckArgs(args []string, minimum int)

CheckArgs checks to see if minimum number of args are provided

func ConvertKeyValuePairArgSliceToMap

func ConvertKeyValuePairArgSliceToMap(keyvals []string) map[string]string

ConvertKeyValuePairArgSliceToMap converts slice of key=value to map

func Debug

func Debug(msg string)

Debug prints debugging info if debug flag is set

func DebugLn

func DebugLn(msg string)

DebugLn prints debugging info if debug flag is set

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 ExitOn

func ExitOn(err error)

ExitOn exits when error occurs

func ExitOnError

func ExitOnError(err error, action string)

ExitOnError exits when error occurs

func ExitOnErrorWithDetail

func ExitOnErrorWithDetail(err error, action, stdout, errout string)

ExitOnErrorWithDetail exits when error occurs, prints addtional info

func Failure

func Failure(msg string)

Failure prints green with xmark preceding the message

func GetAuthenticatedService

func GetAuthenticatedService() (*client.PasswordService, error)

GetAuthenticatedService ensures returned service client is authenticated

func IndentRed

func IndentRed(msg string)

IndentRed prints red with indentation

func Info

func Info(msg string)

Info prints cyan with bullet preceding the message

func Log

func Log(msg string)

Log prints message

func Newline

func Newline()

Newline prints new line

func Print

func Print(msg string)

Print prints specified message

func PrintIndent

func PrintIndent(msg string)

PrintIndent prints message

func Println

func Println(msg string)

Println prints specified message with line before the message

func ReadAuthToken

func ReadAuthToken() (*model.AuthToken, error)

ReadAuthToken reads auth token

func RecursiveName

func RecursiveName(cmd *cobra.Command) string

RecursiveName travels up the parent chain to retrieve name

func Success

func Success(msg string)

Success prints green with checkmark preceding the message

func UpdateExampleOnChildren

func UpdateExampleOnChildren(currCmd *cobra.Command)

UpdateExampleOnChildren updates children's example using parent name recursively

func WriteAuthToken

func WriteAuthToken(authToken *model.AuthToken) error

WriteAuthToken reads auth token

Types

This section is empty.

Jump to

Keyboard shortcuts

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