cli

package
v7.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cli provides tooling to interact with the command-line environment that Git Town runs in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(err error)

Exit prints the given error message and terminates the application.

func Indent

func Indent(message string) string

Indent outputs the given string with the given level of indentation on each line. Each level of indentation is two spaces.

func LogRun

func LogRun(cmd string, args ...string)

LogRun debugs the given executed command on the command line.

func PrintDriverAction

func PrintDriverAction(template string, messages ...interface{})

PrintDriverAction logs activities from a code hosting driver on the CLI.

func PrintDryRunMessage

func PrintDryRunMessage()

PrintDryRunMessage prints the dry-run message.

func PrintError

func PrintError(err error)

PrintError prints the given error message to the console.

func PrintLabelAndValue

func PrintLabelAndValue(label, value string)

PrintLabelAndValue prints the label bolded and underlined the value indented on the next line followed by an empty line.

func PrintableBranchAncestry

func PrintableBranchAncestry(config BranchAncestryConfig) string

PrintableBranchAncestry provides the branch ancestry in CLI printable format.

func PrintableBranchTree

func PrintableBranchTree(branchName string, config BranchAncestryConfig) string

PrintableBranchTree returns a user printable branch tree.

func PrintableMainBranch

func PrintableMainBranch(mainBranch string) string

PrintableMainBranch returns a user printable main branch.

func PrintableNewBranchPushFlag

func PrintableNewBranchPushFlag(flag bool) string

PrintableNewBranchPushFlag returns a user printable new branch push flag.

func PrintableOfflineFlag

func PrintableOfflineFlag(flag bool) string

PrintableOfflineFlag provides a printable version of the given offline flag.

func PrintablePerennialBranches

func PrintablePerennialBranches(perennialBranches []string) string

PrintablePerennialBranches returns a user printable list of perennial branches.

func Printf

func Printf(format string, a ...interface{})

Printf prints the given text using fmt.Printf in a way where colors work on Windows.

func Println

func Println(a ...interface{})

Println prints the given text using fmt.Println in a way where colors work on Windows.

func PrintlnColor

func PrintlnColor(color *color.Color, messages ...interface{})

PrintlnColor prints using the given color function. If that doesn't work, it falls back to printing without color.

func SetDebug

func SetDebug(value bool)

SetDebug sets whether or not we are in debug mode.

Types

type BranchAncestryConfig

type BranchAncestryConfig interface {
	BranchAncestryRoots() []string
	ChildBranches(string) []string
}

BranchAncestryConfig defines the configuration values needed by the `cli` package.

Jump to

Keyboard shortcuts

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