cli

package
v9.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 6 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 BoolSetting

func BoolSetting(value bool) string

BoolSetting provides a human-readable serialization for bool values.

func FormatBool

func FormatBool(value bool) string

FormatBool converts the given bool into either "yes" or "no".

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 PrintConnectorAction

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

PrintConnectorAction logs activities from a code hosting connector on the CLI.

func PrintDryRunMessage

func PrintDryRunMessage()

PrintDryRunMessage prints the dry-run message.

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

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 StringSetting

func StringSetting(text string) string

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