cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package cmd is our cobra cli implementation

Index

Constants

This section is empty.

Variables

View Source
var (
	OutputFormat string
	Logger       *zap.SugaredLogger
	Config       *koanf.Koanf
)
View Source
var (
	// ErrOpenlaneAPITokenMissing is returned when the openlane API token is missing
	ErrOpenlaneAPITokenMissing = fmt.Errorf("OPENLANECLOUD_TOKEN is required")
)
View Source
var RootCmd = &cobra.Command{
	Use:   appName,
	Short: "the openlane-cloud cli",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		initConfiguration(cmd)
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func BarAdd

func BarAdd(bar *progressbar.ProgressBar, num int)

BarAdd is a wrapper around progressbar.Add() that handles error checking

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 SetupClient

func SetupClient(ctx context.Context, host string) (client.Client, error)

SetupClient will setup the openlane cloud client

Types

type RequiredFieldMissingError

type RequiredFieldMissingError struct {
	// Field contains the required field that was missing from the input
	Field string
}

RequiredFieldMissingError is returned when a field is required but not provided

func NewRequiredFieldMissingError

func NewRequiredFieldMissingError(f string) *RequiredFieldMissingError

NewRequiredFieldMissingError returns an error for a missing required field

func (*RequiredFieldMissingError) Error

func (e *RequiredFieldMissingError) Error() string

Error returns the RequiredFieldMissingError in string format

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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