cli

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LeftMargin  = 2
	RightMargin = 2
)

Variables

View Source
var (
	ErrNotRepository = fmt.Errorf("not a repository")
	ErrNotCloned     = fmt.Errorf("not cloned")
)

Functions

func AbortOnRepoState

func AbortOnRepoState(repo domain.Repository, style lipgloss.Style) error

AbortOnRepoState prints an error message and aborts if the repository is in an error state.

func GetMaxLen

func GetMaxLen(project domain.Project) int

GetMaxLen returns length of the widest repo directory in a project.

func GetTheme

func GetTheme(themeSettings domain.Theme) (config.Theme, error)

func ParseArgs

func ParseArgs(args []string, skipRepoSelect bool, deps types.RuntimeCLI) (
	domain.Project, *domain.Repository, error,
)

ParseArgs parses the arguments and returns the project and repo.

func Path

func Path(path, homeDir string) string

Path returns a clean path with ~ for home directory.

func ProjectTitle

func ProjectTitle(project domain.Project, theme config.Theme) string

ProjectTitle returns a formatted project title.

func ProjectTitleWithBullet

func ProjectTitleWithBullet(project domain.Project, theme config.Theme) string

ProjectTitleWithBullet returns a formatted project title.

func ProjectTreeTitle

func ProjectTreeTitle(project domain.Project, homeDir string, theme config.Theme) string

ProjectTreeTitle returns a formatted project title for tree display.

func RenderErrors added in v0.10.0

func RenderErrors(errs []error, excludeWarnings bool) error

func RepoError added in v0.10.0

func RepoError(err error, repo domain.Repository) types.Warning

func RepoTitle

func RepoTitle(repo domain.Repository, basePath string, homeDir string, theme config.Theme) lipgloss.Style

RepoTitle returns a formatted repository title.

func SelectBranch

func SelectBranch(
	projName string,
	repo domain.Repository,
	deps types.RuntimeCLI,
) (string, error)

SelectBranch returns an interactively selected branch name.

func SelectProject

func SelectProject(deps types.RuntimeCLI) (string, error)

SelectProject returns an interactively selected project name.

func SelectRepo

func SelectRepo(
	rootProject string,
	project domain.Project,
	deps types.RuntimeCLI,
) (string, error)

SelectRepo returns an interactively selected repository name.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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