Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cli wires the git-stack commands.

Index

Constants

View Source
const (
	// RepoURL is git-stack's home page.
	RepoURL = "https://github.com/mhvelplund/git-stack"
)

Variables

View Source
var Version = "dev"

Version is set at build time with -ldflags.

Functions

func Execute

func Execute(app *App, args []string) error

Execute runs the root command and maps cobra's own usage errors to InvalidArgs.

func NewRoot

func NewRoot(app *App) *cobra.Command

NewRoot builds the root command.

Types

type App

type App struct {
	Dir         string
	In          io.Reader
	Out, Err    io.Writer
	Interactive bool // stdin and stderr are terminals: editors and prompts use those
	OutIsTTY    bool
	ErrIsTTY    bool
	Now         func() time.Time
	// Sleep waits between polls of the host (tests make it instant).
	Sleep func(time.Duration)
	// RunTUI runs a full-screen editor (tests drive it with scripted keys).
	RunTUI func(m tea.Model) (tea.Model, error)
	// OpenURL opens a browser (tests capture the URL).
	OpenURL func(url string) error
	// Provider is the --provider flag: a provider name, "none", or "" to use
	// git config or detect it from the remote URL.
	Provider string
	// NewForge overrides how forges are built (tests use a fake).
	NewForge func(remote string) (*forge.Forge, error)
	// contains filtered or unexported fields
}

App is the environment commands run in. Tests construct it directly.

func NewApp

func NewApp() (*App, error)

NewApp returns an App bound to the process's stdio and working directory.

Jump to

Keyboard shortcuts

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