prompt

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: GPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package prompt provides interactive prompt functionality for CM.

Index

Constants

View Source
const (
	// TargetRepository is the string representation of repository target type.
	TargetRepository = "repository"
	// TargetWorkspace is the string representation of workspace target type.
	TargetWorkspace = "workspace"
)

Target type string constants.

Variables

View Source
var (
	ErrInvalidConfirmationInput = errors.New("invalid input: please enter 'y' or 'n'")
)

Error definitions for prompt package.

Functions

This section is empty.

Types

type Prompter added in v0.19.0

type Prompter interface {
	// PromptForRepositoriesDir prompts the user for the repositories directory with examples.
	PromptForRepositoriesDir(defaultRepositoriesDir string) (string, error)

	// PromptForWorkspacesDir prompts the user for the workspaces directory with examples.
	PromptForWorkspacesDir(defaultWorkspacesDir string) (string, error)

	// PromptForStatusFile prompts the user for the status file location with examples.
	PromptForStatusFile(defaultStatusFile string) (string, error)

	// PromptForConfirmation prompts the user for confirmation with a default value.
	PromptForConfirmation(message string, defaultYes bool) (bool, error)

	// PromptSelectTarget prompts the user to select a repository or workspace from a list.
	// showWorktreeLabel controls rendering of ": worktree" suffix.
	PromptSelectTarget(choices []TargetChoice, showWorktreeLabel bool) (TargetChoice, error)

	// PromptForBranchName prompts the user for a branch name.
	PromptForBranchName() (string, error)
}

Prompter interface provides user interaction functionality.

func NewPrompt

func NewPrompt() Prompter

NewPrompt creates a new Prompt instance.

type TargetChoice added in v0.29.0

type TargetChoice struct {
	Type     string
	Name     string
	Worktree string // optional label for display only
}

TargetChoice represents a selectable target with optional worktree information.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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