Documentation ¶
Overview ¶
Package cli provides tooling to interact with the command-line environment that Git Town runs in.
Index ¶
- func BoolSetting(value bool) string
- func FormatBool(value bool) string
- func Indent(message string) string
- func PrintConnectorAction(template string, messages ...interface{})
- func PrintDryRunMessage()
- func PrintEntry(label, value string)
- func PrintError(err error)
- func PrintHeader(text string)
- func PrintLabelAndValue(label, value string)
- func PrintableBranchAncestry(config BranchAncestryConfig) string
- func PrintableBranchTree(branch string, config BranchAncestryConfig) string
- func Printf(format string, a ...interface{})
- func Println(a ...interface{})
- func PrintlnColor(color *color.Color, messages ...interface{})
- func StringSetting(text string) string
- type BranchAncestryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolSetting ¶
BoolSetting provides a human-readable serialization for bool values.
func FormatBool ¶
FormatBool converts the given bool into either "yes" or "no".
func Indent ¶
Indent outputs the given string with the given level of indentation on each line. Each level of indentation is two spaces.
func PrintConnectorAction ¶
func PrintConnectorAction(template string, messages ...interface{})
PrintConnectorAction logs activities from a code hosting connector on the CLI.
func PrintEntry ¶
func PrintEntry(label, value string)
func PrintError ¶
func PrintError(err error)
PrintError prints the given error message to the console.
func PrintHeader ¶
func PrintHeader(text string)
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(branch string, config BranchAncestryConfig) string
PrintableBranchTree returns a user printable branch tree.
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.
func StringSetting ¶
Types ¶
type BranchAncestryConfig ¶
type BranchAncestryConfig interface { BranchAncestryRoots() []string ChildBranches(string) []string }
BranchAncestryConfig defines the configuration values needed by the `cli` package.