cmd

package
v0.0.0-...-d240bf2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: EUPL-1.2 Imports: 21 Imported by: 0

Documentation

Overview

Package cmd contains the command-line interface code.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBuildInformation = errors.New("no build information available, can't obtain version")
)

Functions

This section is empty.

Types

type CLI

type CLI struct {
	LogLevel   slog.LevelVar         `kong:"optional,group='logging',env='LOG_LEVEL',default='info',placeholder='level',help='log level'"`
	LogJSON    bool                  `kong:"optional,group='logging',env='LOG_JSON',negatable,help='log using JSON'"`
	LogSource  bool                  `kong:"optional,group='logging',env='LOG_SOURCE',hidden,help='log source (filename and line number)'"`
	CPUProfile *cpuprofiler.Profiler `kong:"optional,hidden,help='profile cpu destination',placeholder='FILENAME'"`

	// Commands:
	Lint        LintCommand        `kong:"cmd,default='',help='lint the commit messages in a git repository'"`
	NextVersion NextVersionCommand `kong:"cmd,help='get next version (lint is recommended prior to running this)'"`
	Version     VersionCommand     `kong:"cmd,help='show program version'"`
}

type LintCommand

type LintCommand struct {
	Repository    *git.Repository   `kong:"placeholder='path',default='.',help='repository to lint'"`
	Revision      plumbing.Revision `kong:"name='revision',aliases='rev',optional,default='HEAD',placeholder='REVISION',help='revision to start at'"`
	OtherRevision plumbing.Revision `` /* 130-byte string literal not displayed */
}

func (*LintCommand) Run

func (cmd *LintCommand) Run(ctx context.Context, l *slog.Logger) error

type NextVersionCommand

type NextVersionCommand struct {
	Repository     *git.Repository   `kong:"arg,placeholder='path',default='.',help='repository to lint'"`
	Revision       plumbing.Revision `kong:"arg,name='revision',aliases='rev',optional,default='HEAD',placeholder='REVISION',help='revision to start at'"`
	Output         string            `kong:"arg,type='path',default='-',help='where to output the next version'"`
	VSuffix        bool              `kong:"default='true',negatable,help='output with v-suffix, i.e. v1.3.2'"`
	WithPrerelease string            `kong:"optional,help='add prerelease information to tag'"`
	WithMetadata   string            `kong:"optional,help='add metadata to tag'"`
}

func (*NextVersionCommand) Run

func (cmd *NextVersionCommand) Run(ctx context.Context, l *slog.Logger) error

type StatusCode

type StatusCode = int
const (
	StatusOK StatusCode = iota
	StatusInternalError
	StatusBadArguments
	StatusFailure
)

func Run

func Run() StatusCode

type VersionCommand

type VersionCommand struct{}

func (*VersionCommand) Run

func (cmd *VersionCommand) Run(ctx context.Context, l *slog.Logger) error

Jump to

Keyboard shortcuts

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