cmd

package
v0.0.0-...-b519c2c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExitCodeOK is a 0 exit code.
	ExitCodeOK = iota
	// ExitCodeErr is a generic exit code, for all non-special errors.
	ExitCodeErr
)
View Source
const AppName = "fget"

AppName - the name of the application.

Variables

View Source
var (
	ErrGitMissingRemoteHeadReference  = errors.New("missing remote head reference")
	ErrGitMissingBranchName           = errors.New("missing branch name")
	ErrGitMissingRemoteHeadBranchName = errors.New("missing remote HEAD branch name")
	ErrGitRepositoryNotReachable      = errors.New("repository not reachable")
	ErrGitRepositoryDisabled          = errors.New("repository is disabled")
	ErrGitRepositoryProtected         = errors.New("repository is protected")
)

Functions

func ErrExit

func ErrExit(w io.Writer, err error)

ErrExit writes an error to the given io.Writer & exits.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called my main.main(). It only needs to happen once to the rootCmd.

func ExitIfErr

func ExitIfErr(w io.Writer, err error)

ExitIfErr only calls ErrExit if there is an error present.

func GetWd

func GetWd() string

GetWd is a convenience method to get the working directory.

Types

type GitRepositoryMovedError

type GitRepositoryMovedError struct {
	OldURL string
	NewURL string
}

func (*GitRepositoryMovedError) Error

func (e *GitRepositoryMovedError) Error() string

type VersionInfo

type VersionInfo struct {
	Version string
	Commit  string
	BuiltBy string
}

A VersionInfo contains a version.

Jump to

Keyboard shortcuts

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