cmd

package
v0.0.0-...-3749d00 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cmd provides the command line interface for verscout

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the root command.

func HandleLatestCommand

func HandleLatestCommand(
	writer io.Writer,
	git GitInterface,
	repoDirectoryPath *string,
	noLatestVersionExitCode int,
) error

HandleLatestCommand performs the version retrieval logic for the latest command.

func HandleNextCommand

func HandleNextCommand(
	writer io.Writer,
	git GitInterface,
	repoDirectoryPath *string,
	noNextVersionExitCode int,
	configPath string,
	firstVersion string,
) error

HandleNextCommand performs the version calculation logic for the next command. It retrieves the latest version tag, analyzes commit messages since that tag, and calculates the next version based on semantic versioning rules.

func NewLatestCmd

func NewLatestCmd(git GitInterface, repoDirectoryPath *string) *cobra.Command

NewLatestCmd creates and returns a cobra.Command for retrieving the latest version tag.

func NewNextCmd

func NewNextCmd(git GitInterface, repoDirectoryPath *string) *cobra.Command

NewNextCmd creates and returns a cobra.Command for calculating the next semantic version. It uses git operations to find the latest version tag and analyzes commit messages to determine the next version according to semantic versioning rules.

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd creates the root command for the CLI application. This command serves as the entry point and parent for all other commands.

Types

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError is a custom error type that includes an exit code and an underlying error. It is used to signal specific exit conditions for the CLI application.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

type Git

type Git struct{}

Git implements the GitInterface for interacting with git repositories.

func (*Git) PlainOpen

func (g *Git) PlainOpen(path string) (*git.Repository, error)

PlainOpen opens a git repository at the specified path.

type GitInterface

type GitInterface interface {
	PlainOpen(path string) (*git.Repository, error)
}

GitInterface defines the required git operations for version management.

Jump to

Keyboard shortcuts

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