Documentation ¶
Overview ¶
Package cli provides tooling to interact with the command-line environment that Git Town runs in.
Index ¶
- func Exit(err error)
- func Indent(message string) string
- func LogRun(cmd string, args ...string)
- func PrintDriverAction(template string, messages ...interface{})
- func PrintDryRunMessage()
- func PrintError(err error)
- func PrintLabelAndValue(label, value string)
- func PrintableBranchAncestry(config BranchAncestryConfig) string
- func PrintableBranchTree(branchName string, config BranchAncestryConfig) string
- func PrintableMainBranch(mainBranch string) string
- func PrintableNewBranchPushFlag(flag bool) string
- func PrintableOfflineFlag(flag bool) string
- func PrintablePerennialBranches(perennialBranches []string) string
- func Printf(format string, a ...interface{})
- func Println(a ...interface{})
- func PrintlnColor(color *color.Color, messages ...interface{})
- func SetDebug(value bool)
- type BranchAncestryConfig
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 ¶
Indent outputs the given string with the given level of indentation on each line. Each level of indentation is two spaces.
func PrintDriverAction ¶
func PrintDriverAction(template string, messages ...interface{})
PrintDriverAction logs activities from a code hosting driver on the CLI.
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 ¶
PrintableMainBranch returns a user printable main branch.
func PrintableNewBranchPushFlag ¶
PrintableNewBranchPushFlag returns a user printable new branch push flag.
func PrintableOfflineFlag ¶
PrintableOfflineFlag provides a printable version of the given offline flag.
func PrintablePerennialBranches ¶
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 ¶
PrintlnColor prints using the given color function. If that doesn't work, it falls back to printing without color.
Types ¶
type BranchAncestryConfig ¶
type BranchAncestryConfig interface { BranchAncestryRoots() []string ChildBranches(string) []string }
BranchAncestryConfig defines the configuration values needed by the `cli` package.