cmd

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package cmd messages - error and log message constants Exported so tests can compare against them

Index

Constants

View Source
const (
	ErrLoadingVersion    = "error loading version"
	ErrCustomKeyNotFound = "custom key not found"
)

Error messages

View Source
const (
	LogCommandStarted   = "command_started"
	LogCommandCompleted = "command_completed"
	LogCommandFailed    = "command_failed"
	LogTagCreated       = "tag_created"
	LogEmitCompleted    = "emit_completed"
)

Log messages for structured logging

View Source
const (
	// FilePermission is the default permission for created files (owner rw, group/other r)
	FilePermission os.FileMode = 0644
)

File permission constants

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately.

Types

type CLISchema

type CLISchema struct {
	Schema            string             `json:"$schema"`
	Name              string             `json:"name"`
	Version           string             `json:"version"`
	Description       string             `json:"description"`
	Generated         string             `json:"generated"`
	Commands          []CommandSchema    `json:"commands"`
	GlobalFlags       []FlagSchema       `json:"globalFlags"`
	TemplateVariables TemplateVarsSchema `json:"templateVariables"`
}

CLISchema is the root schema describing the CLI

type CommandSchema

type CommandSchema struct {
	Name        string          `json:"name"`
	Path        []string        `json:"path"`
	Short       string          `json:"short"`
	Long        string          `json:"long,omitempty"`
	Usage       string          `json:"usage"`
	Aliases     []string        `json:"aliases,omitempty"`
	Flags       []FlagSchema    `json:"flags,omitempty"`
	Subcommands []CommandSchema `json:"subcommands,omitempty"`
}

CommandSchema describes a CLI command

type FlagSchema

type FlagSchema struct {
	Name        string `json:"name"`
	Shorthand   string `json:"shorthand,omitempty"`
	Type        string `json:"type"`
	Default     string `json:"default"`
	Description string `json:"description"`
}

FlagSchema describes a CLI flag

type TemplateVarSchema

type TemplateVarSchema struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Example     string `json:"example,omitempty"`
}

TemplateVarSchema describes a template variable

type TemplateVarsSchema

type TemplateVarsSchema struct {
	VersionComponents []TemplateVarSchema `json:"versionComponents"`
	PreRelease        []TemplateVarSchema `json:"preRelease"`
	Metadata          []TemplateVarSchema `json:"metadata"`
	VCS               []TemplateVarSchema `json:"vcs"`
	CommitInfo        []TemplateVarSchema `json:"commitInfo"`
	BuildTimestamps   []TemplateVarSchema `json:"buildTimestamps"`
}

TemplateVarsSchema groups template variables by category

Jump to

Keyboard shortcuts

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