cliutils

package
v2.56.8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// Common
	Threads = 3

	// Environment variables
	JfrogCliAvoidDeprecationWarnings = "JFROG_CLI_AVOID_DEPRECATION_WARNINGS"
)

Variables

This section is empty.

Functions

func CreateServerDetailsWithConfigOffer

func CreateServerDetailsWithConfigOffer(createServerDetails func() (*config.ServerDetails, error), excludeRefreshableTokens bool) (*config.ServerDetails, error)

Exclude refreshable tokens parameter should be true when working with external tools (build tools, curl, etc) or when sending requests not via ArtifactoryHttpClient.

func FixWinPathBySource

func FixWinPathBySource(path string, fromSpec bool) string

func FixWinPathsForFileSystemSourcedCmds

func FixWinPathsForFileSystemSourcedCmds(uploadSpec *spec.SpecFiles, specFlag, exclusionsFlag bool)

func GetCLIDocumentationMessage

func GetCLIDocumentationMessage() string

func GetThreadsCount

func GetThreadsCount(threadCountStrVal string) (threads int, err error)

func HandleSecretInput

func HandleSecretInput(stringFlag, secretRaw, stdinFlag string, isStdin bool) (secret string, err error)

Get a secret value from a flag or from stdin.

func LogNonGenericAuditCommandDeprecation

func LogNonGenericAuditCommandDeprecation(cmdName string)

func LogNonNativeCommandDeprecation

func LogNonNativeCommandDeprecation(cmdName, oldSubcommand string)

func OfferConfig

func OfferConfig(createServerDetails func() (*config.ServerDetails, error)) (*config.ServerDetails, error)

func PrintHelpAndReturnError

func PrintHelpAndReturnError(msg string, printHelp func() error) error

func ShouldLogWarning

func ShouldLogWarning() bool

func ShouldOfferConfig

func ShouldOfferConfig() (bool, error)

func ShowCmdHelpIfNeeded

func ShowCmdHelpIfNeeded(args []string, printHelp func() error) (bool, error)

This function checks whether the command received --help as a single option. If it did, the command's help is shown and true is returned. This function should be used iff the SkipFlagParsing option is used.

func ShowGenericCmdHelpIfNeeded

func ShowGenericCmdHelpIfNeeded(args []string, printHelp func() error) (bool, error)

This function checks whether the command received --help as a single option. This function should be used iff the SkipFlagParsing option is used. Generic commands such as docker, don't have dedicated subcommands. As a workaround, printing the help of their subcommands, we use a dummy command with no logic but the help message. to trigger the print of those dummy commands, each generic command must decide what cmdName it needs to pass to this function. For example, 'jf docker scan --help' passes cmdName='dockerscanhelp' to print our help and not the origin from docker client/cli.

func WrongNumberOfArgumentsHandler

func WrongNumberOfArgumentsHandler(argCount int, printHelp func() error) error

Types

type CommandDomain

type CommandDomain string
const (
	Rt       CommandDomain = "rt"
	Ds       CommandDomain = "ds"
	Xr       CommandDomain = "xr"
	Platform CommandDomain = "platform"
)

Jump to

Keyboard shortcuts

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