flags

package
v0.0.0-...-c25eef7 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package flags holds logics for use of CLI flags.

Index

Constants

This section is empty.

Variables

View Source
var (
	// BaseBranch is the variable for the CLI flag `--base-branch` so you can set
	// your git base branch if it's anything other than `main`.
	BaseBranch string
	// Commit is the variable for the CLI flag `--commit` used to tell the `bump`
	// command to commit the version file after bumping.
	Commit bool
	// CommitMsg is the variable for the CLI flag `--commit-msg` used when
	// committing version file changes with the `bump` command.
	CommitMsg string
	// Now is the variable for the CLI flag `--now`.
	Now string
	// Was is the variable for the CLI flag `--was`.
	Was string
	// Verbose is the variable for the CLI flag `--verbose` to enable debug log output.
	Verbose bool
	// VersionFile is the variable for the CLI flag `--file` to provide a specific
	// version file path, rather than having vrsn try and work out what to use.
	VersionFile string
)

Functions

func Validate

func Validate(was string, now string) error

Validate checks that both required values have been supplied.

Types

type Error

type Error uint

Error is the error type.

const (
	// ErrNoValues is the error when both was or now are not supplied.
	ErrNoValues Error = iota
	// ErrNoNowValue is the error when no --now value is supplied.
	ErrNoNowValue
	// ErrNoWasValue is the error when no --was value iss supplied.
	ErrNoWasValue
)

func (Error) Error

func (e Error) Error() string

Error returns the error string for the error enum.

Jump to

Keyboard shortcuts

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