cliutil

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 on the given command.

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