cmd

package
v1.66.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Shared helpers across commands.

Index

Constants

This section is empty.

Variables

View Source
var (

	// This works so long as the current dir structure stays the same.
	// This should be the base of the project e.g. '/home/user1/kiali'.
	// If the location of this file changes, this needs to be updated as well.
	KialiProjectRoot = path.Dir(path.Dir(basepath))
)

Functions

func ConfigureKialiLogger

func ConfigureKialiLogger()

func GetKubeConfig

func GetKubeConfig() (*rest.Config, error)

GetKubeConfig constructs a kube config from either the user's local kube config or the KUBECONFIG env var.

func Usage

func Usage(cmd string, posArgs ...string) func()

Usage creates a custom usage function that allows you to specify position arguments and prints flags with two dashes instead of one e.g. '--url' instead of '-url'.

You can assign this to flag.Usage directly or any other FlagSet.Usage e.g. 'flag.Usage = Usage(requiredFlag1)'.

The resulting Usage will look like: Usage: cmd <pos-arg1> <pos-arg2> ... [Options]

Options: --opt1 string opt description (default "") ...

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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