cliutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitterVersion = "0.0.2"
	CommitterName    = "Committer"
)

Service names and version.

Variables

This section is empty.

Functions

func FullCommitterVersion

func FullCommitterVersion() string

FullCommitterVersion returns the committer version string.

func SetDefaultFlags

func SetDefaultFlags(cmd *cobra.Command, configPath *string)

SetDefaultFlags registers the --config flag for the cmd parameter.

func StartDefaultSystem

func StartDefaultSystem(t *testing.T) config.SystemConfig

StartDefaultSystem starts a system with mocks for CMD testing.

func UnitTestRunner

func UnitTestRunner(
	t *testing.T,
	cmd *cobra.Command,
	cmdTest CommandTest,
)

UnitTestRunner is a function that runs a unit test with the requested parameters passed in CommandTest structure.

func VersionCmd

func VersionCmd() *cobra.Command

VersionCmd creates a version command.

Types

type CommandTest

type CommandTest struct {
	Name              string
	Args              []string
	CmdLoggerOutputs  []string
	CmdStdOutput      string
	CmdStdErrOutput   string
	Err               error
	UseConfigTemplate string
	System            config.SystemConfig
}

CommandTest is a struct that represents a CMD unit test.

Jump to

Keyboard shortcuts

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