cmd

package
v0.0.0-...-39ca269 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK = iota
	ExitCodeError
)

Status code

View Source
const Version = "0.8.0"

Version of git-chglog cli client

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute : Gather URFave CLI args and run the program with those settings

func JustDo

func JustDo(s *ShimConf) (err error)

JustDo : A bring-your-own-config-gathering-tool example option to start the program without URFave CLI.

Types

type Answer

type Answer struct {
	RepositoryURL       string `survey:"repository_url"`
	Style               string `survey:"style"`
	CommitMessageFormat string `survey:"commit_message_format"`
	Template            string `survey:"template"`
	IncludeMerges       bool   `survey:"include_merges"`
	IncludeReverts      bool   `survey:"include_reverts"`
	ConfigDir           string `survey:"config_dir"`
}

Answer ...

type Builder

type Builder interface {
	Build(*Answer) (string, error)
}

Builder ...

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI ...

func NewCLI

func NewCLI(
	ctx *CLIContext, fs FileSystem,
	configLoader ConfigLoader,
	generator Generator,
) *CLI

NewCLI ...

func (*CLI) Run

func (c *CLI) Run() int

Run ...

type CLIContext

type CLIContext struct {
	WorkingDir string
	Stdout     io.Writer
	Stderr     io.Writer
	ConfigPath string
	OutputPath string
	Silent     bool
	NoColor    bool
	NoEmoji    bool
	Query      string
	NextTag    string
}

CLIContext ...

type CommitGroupOptions

type CommitGroupOptions struct {
	GroupBy   string            `yaml:"group_by"`
	SortBy    string            `yaml:"sort_by"`
	TitleMaps map[string]string `yaml:"title_maps"`
}

CommitGroupOptions ...

type CommitMessageFormat

type CommitMessageFormat struct {
	// contains filtered or unexported fields
}

CommitMessageFormat ...

func (*CommitMessageFormat) Display

func (f *CommitMessageFormat) Display() string

Display ...

func (*CommitMessageFormat) PatternMapString

func (f *CommitMessageFormat) PatternMapString() string

PatternMapString ...

func (*CommitMessageFormat) Preview

func (f *CommitMessageFormat) Preview() string

Preview ...

type CommitOptions

type CommitOptions struct {
	Filters map[string][]string `yaml:"filters"`
	SortBy  string              `yaml:"sort_by"`
}

CommitOptions ...

type Config

type Config struct {
	Bin      string  `yaml:"bin"`
	Template string  `yaml:"template"`
	Style    string  `yaml:"style"`
	Info     Info    `yaml:"info"`
	Options  Options `yaml:"options"`
}

Config ...

func (*Config) Convert

func (config *Config) Convert(ctx *CLIContext) *chglog.Config

Convert ...

func (*Config) Normalize

func (config *Config) Normalize(ctx *CLIContext) error

Normalize ...

type ConfigBuilder

type ConfigBuilder interface {
	Builder
}

ConfigBuilder ...

func NewConfigBuilder

func NewConfigBuilder() ConfigBuilder

NewConfigBuilder ...

type ConfigLoader

type ConfigLoader interface {
	Load(string) (*Config, error)
}

ConfigLoader ...

func NewConfigLoader

func NewConfigLoader() ConfigLoader

NewConfigLoader ...

type File

type File interface {
	io.Closer
	io.Reader
	io.ReaderAt
	io.Seeker
	io.Writer
	Stat() (os.FileInfo, error)
}

File ...

type FileSystem

type FileSystem interface {
	Exists(path string) bool
	MkdirP(path string) error
	Create(name string) (File, error)
	WriteFile(path string, content []byte) error
}

FileSystem ...

type Generator

type Generator interface {
	Generate(io.Writer, string, *chglog.Config) error
}

Generator ...

func NewGenerator

func NewGenerator() Generator

NewGenerator ...

func NewGeneratorSemVer

func NewGeneratorSemVer() Generator

NewGeneratorSemVer : Returns a SemVer safe generator

type Info

type Info struct {
	Title         string `yaml:"title"`
	RepositoryURL string `yaml:"repository_url"`
}

Info ...

type InitContext

type InitContext struct {
	WorkingDir string
	Stdout     io.Writer
	Stderr     io.Writer
}

InitContext ...

type Initializer

type Initializer struct {
	// contains filtered or unexported fields
}

Initializer ...

func NewInitializer

func NewInitializer(
	ctx *InitContext,
	fs FileSystem,
	questioner Questioner,
	configBuilder ConfigBuilder,
	tplBuilderFactory TemplateBuilderFactory) *Initializer

NewInitializer ...

func (*Initializer) Run

func (init *Initializer) Run() int

Run ...

type IssueOptions

type IssueOptions struct {
	Prefix []string `yaml:"prefix"`
}

IssueOptions ...

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger ...

func NewLogger

func NewLogger(stdout, stderr io.Writer, silent, noEmoji bool) *Logger

NewLogger ...

func (*Logger) Error

func (l *Logger) Error(msg string)

Error ...

func (*Logger) Log

func (l *Logger) Log(msg string)

Log ...

type NoteOptions

type NoteOptions struct {
	Keywords []string `yaml:"keywords"`
}

NoteOptions ...

type Options

type Options struct {
	Commits      CommitOptions      `yaml:"commits"`
	CommitGroups CommitGroupOptions `yaml:"commit_groups"`
	Header       PatternOptions     `yaml:"header"`
	Issues       IssueOptions       `yaml:"issues"`
	Refs         RefOptions         `yaml:"refs"`
	Merges       PatternOptions     `yaml:"merges"`
	Reverts      PatternOptions     `yaml:"reverts"`
	Notes        NoteOptions        `yaml:"notes"`
}

Options ...

type PatternOptions

type PatternOptions struct {
	Pattern     string   `yaml:"pattern"`
	PatternMaps []string `yaml:"pattern_maps"`
}

PatternOptions ...

type Previewable

type Previewable interface {
	Display() string
	Preview() string
}

Previewable ...

type ProcessorFactory

type ProcessorFactory struct {
	// contains filtered or unexported fields
}

ProcessorFactory ...

func NewProcessorFactory

func NewProcessorFactory() *ProcessorFactory

NewProcessorFactory ...

func (*ProcessorFactory) Create

func (factory *ProcessorFactory) Create(config *Config) (chglog.Processor, error)

Create ...

type Questioner

type Questioner interface {
	Ask() (*Answer, error)
}

Questioner ...

func NewQuestioner

func NewQuestioner(client gitcmd.Client, fs FileSystem) Questioner

NewQuestioner ...

type RefOptions

type RefOptions struct {
	Actions []string `yaml:"actions"`
}

RefOptions ...

type ShimConf

type ShimConf struct {
	Init       bool
	ConfigPath string
	OutputPath string
	Query      string
	NextTag    string
	Silent     bool
	NoColor    bool
	NoEmoji    bool
	SemVerOnly bool
}

ShimConf : Conf loader that stores the variables needed to run the library without URFave CLI

func (*ShimConf) Do

func (c *ShimConf) Do() (err error)

Do : Start up the git-chnglog commands without using the Urfave CLI

type TemplateBuilder

type TemplateBuilder interface {
	Builder
}

TemplateBuilder ...

func NewCustomTemplateBuilder

func NewCustomTemplateBuilder() TemplateBuilder

NewCustomTemplateBuilder ...

func NewKACTemplateBuilder

func NewKACTemplateBuilder() TemplateBuilder

NewKACTemplateBuilder ...

type TemplateBuilderFactory

type TemplateBuilderFactory = func(string) TemplateBuilder

TemplateBuilderFactory ...

type TemplateStyleFormat

type TemplateStyleFormat struct {
	// contains filtered or unexported fields
}

TemplateStyleFormat ...

func (*TemplateStyleFormat) Display

func (t *TemplateStyleFormat) Display() string

Display ...

func (*TemplateStyleFormat) Preview

func (t *TemplateStyleFormat) Preview() string

Preview ...

Jump to

Keyboard shortcuts

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