Documentation
¶
Overview ¶
Package cmd provides the command line interface for verscout
Index ¶
- func Execute()
- func HandleLatestCommand(writer io.Writer, git GitInterface, repoDirectoryPath *string, ...) error
- func HandleNextCommand(writer io.Writer, git GitInterface, repoDirectoryPath *string, ...) error
- func NewLatestCmd(git GitInterface, repoDirectoryPath *string) *cobra.Command
- func NewNextCmd(git GitInterface, repoDirectoryPath *string) *cobra.Command
- func NewRootCmd() *cobra.Command
- type ExitError
- type Git
- type GitInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
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.
type GitInterface ¶
type GitInterface interface {
PlainOpen(path string) (*git.Repository, error)
}
GitInterface defines the required git operations for version management.