program

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "unknown"

Functions

This section is empty.

Types

type Changelog

type Changelog struct {
	MaxCommits             int               `short:"n" group:"source" default:"1000" help:"max number of commits to check"`
	SinceTag               string            `short:"s" group:"source" help:"Tag from which to start" aliases:"since"`
	AllCommits             bool              `` /* 128-byte string literal not displayed */
	DefaultType            changes.TypeTag   `default:"fix" group:"calculation" help:"if type is not specified in commit, assume this type"`
	GuessMissingCommitType bool              `default:"true" group:"calculation" negatable:"" help:"If commit type is missing, take a guess about which it is"`
	Order                  []changes.TypeTag `default:"${type_order}" group:"calculation" help:"order in which to list commit message types"`
}

func (*Changelog) CalculateChanges

func (c *Changelog) CalculateChanges(r *repo.Repository) (*changes.ChangeSet, error)

func (*Changelog) Run

func (c *Changelog) Run(program *Options) error

type Options

type Options struct {
	Debug     bool   `short:"d" group:"info" help:"Show debugging information"`
	LogFormat string `short:"l" group:"info" enum:"auto,jsonl,terminal" default:"auto" help:"How to show program output (auto|terminal|jsonl)"`
	Quiet     bool   `short:"q" group:"info" help:"Be less verbose than usual"`

	Path   string `default:"." group:"locations" type:"existingdir" short:"p" help:"Path for the git worktree/repo to log"`
	Output string `default:"-" group:"locations" short:"o" help:"File to which to send output"`

	Changelog  Changelog  `cmd:"" help:"calculate changelogs"`
	VersionCmd VersionCmd `name:"version" cmd:"" help:"show program version"`
	Semver     Semver     `cmd:"" help:"Manipulate Semantic Versions"`

	OutFP *os.File `kong:"-"`
}

Options is the structure of program options

func (*Options) AfterApply added in v0.4.0

func (program *Options) AfterApply() error

func (*Options) Init

func (program *Options) Init()

func (*Options) Parse added in v0.4.0

func (program *Options) Parse(args []string) (*kong.Context, error)

Parse calls the CLI parsing routines

func (*Options) Repository added in v0.4.0

func (program *Options) Repository() (*repo.Repository, error)

Repository opens the git repository

func (*Options) Run

func (program *Options) Run(_ *Options) error

Run runs the program

type Semver

type Semver struct {
	Changelog
	FromFile       string   `` /* 144-byte string literal not displayed */
	ReplaceIn      []string `group:"locations" type:"existingfile" placeholder:"FILE" help:"Replace version in these files"`
	Tag            bool     `group:"locations" short:"t" help:"run 'git tag' with the calculated semver"`
	AllowUntracked bool     `group:"calculation" help:"allow untracked files to count as clean"`
}

func (*Semver) FindPreviousVersion

func (s *Semver) FindPreviousVersion(r *repo.Repository) (semver.Version, string, error)

func (*Semver) ReplaceInFile

func (s *Semver) ReplaceInFile(filename string, new string) error

func (*Semver) Run

func (s *Semver) Run(program *Options) error

type VersionCmd

type VersionCmd struct{}

func (*VersionCmd) Run

func (v *VersionCmd) Run(program *Options) error

Jump to

Keyboard shortcuts

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