Documentation
¶
Index ¶
- func SplitWithDash(args []string, dashIndex int) (patterns, command []string)
- type DiffArgs
- type DoArgs
- type FetchArgs
- type GetArgs
- type GrepArgs
- type ListArgs
- type LsFilesArgs
- type PullArgs
- type ReadArgs
- type StatusArgs
- type WorktreeAddArgs
- type WorktreeListArgs
- type WorktreePruneArgs
- type WorktreeRemoveArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitWithDash ¶
SplitWithDash splits args into patterns (before dash) and command/flags (after dash). If dashIndex >= 0 (provided by Cobra ArgsLenAtDash), it splits at that index. Otherwise, it falls back to looking for a literal "--" element in args.
Types ¶
type DiffArgs ¶
type DiffArgs struct {
Patterns []string // repository filter regexps; empty means all
DiffFlags []string // optional arguments forwarded to "git diff"
Interactive bool // whether to run git diff interactively (with pager)
}
DiffArgs is the parsed argument set for the "diff" subcommand.
func ParseDiffArgs ¶
ParseDiffArgs parses raw cobra args into DiffArgs.
func ParseDiffArgsWithDash ¶
ParseDiffArgsWithDash parses args taking into account Cobra's ArgsLenAtDash().
type DoArgs ¶
type DoArgs struct {
Patterns []string // repository filter regexps
Command []string // command to run in each matching repo
}
DoArgs is the parsed argument set for the "do" subcommand.
func ParseDoArgs ¶
ParseDoArgs parses raw cobra args into DoArgs. Returns an error when no COMMAND is provided after "--".
type FetchArgs ¶
type FetchArgs struct {
Patterns []string // repository filter regexps; empty means all
FetchFlags []string // optional arguments forwarded to "git fetch"
}
FetchArgs is the parsed argument set for the "fetch" subcommand.
func ParseFetchArgs ¶
ParseFetchArgs parses raw cobra args into FetchArgs.
func ParseFetchArgsWithDash ¶
ParseFetchArgsWithDash parses args taking into account Cobra's ArgsLenAtDash().
type GetArgs ¶ added in v0.3.0
type GetArgs struct {
URI string // repository URI to clone/resolve; empty means list all repositories
}
GetArgs is the parsed argument set for the "get" subcommand.
func ParseGetArgs ¶ added in v0.3.0
ParseGetArgs parses raw cobra args into GetArgs.
type GrepArgs ¶
type GrepArgs struct {
Patterns []string // repository filter regexps
GitGrepArgs []string // arguments forwarded verbatim to "git grep"
}
GrepArgs is the parsed argument set for the "grep" subcommand.
func ParseGrepArgs ¶
ParseGrepArgs parses raw cobra args into GrepArgs. Returns an error when no GIT_GREP_ARGS are provided after "--".
type ListArgs ¶
type ListArgs struct {
Patterns []string // repository filter regexps; empty means all
}
ListArgs is the parsed argument set for the "list" subcommand.
func ParseListArgs ¶
ParseListArgs parses raw cobra args into ListArgs. Never errors.
type LsFilesArgs ¶
type LsFilesArgs struct {
Patterns []string // repository filter regexps; empty means all
LsFilesFlags []string // optional arguments forwarded to "git ls-files"
}
LsFilesArgs is the parsed argument set for the "ls-files" subcommand.
func ParseLsFilesArgs ¶
func ParseLsFilesArgs(args []string) LsFilesArgs
ParseLsFilesArgs parses raw cobra args into LsFilesArgs.
func ParseLsFilesArgsWithDash ¶
func ParseLsFilesArgsWithDash(args []string, dashIndex int) LsFilesArgs
ParseLsFilesArgsWithDash parses args taking into account Cobra's ArgsLenAtDash().
type PullArgs ¶
type PullArgs struct {
Patterns []string // repository filter regexps; empty means all
PullFlags []string // optional arguments forwarded to "git pull"
}
PullArgs is the parsed argument set for the "pull" subcommand.
func ParsePullArgs ¶
ParsePullArgs parses raw cobra args into PullArgs.
func ParsePullArgsWithDash ¶
ParsePullArgsWithDash parses args taking into account Cobra's ArgsLenAtDash().
type ReadArgs ¶
type ReadArgs struct {
Command []string // command to run in each repo read from stdin
}
ReadArgs is the parsed argument set for the "read" subcommand.
func ParseReadArgs ¶
ParseReadArgs parses raw cobra args into ReadArgs. Never errors; cobra MinimumNArgs(1) ensures args is non-empty before RunE is called.
type StatusArgs ¶
type StatusArgs struct {
Patterns []string // repository filter regexps; empty means all
StatusFlags []string // optional arguments forwarded to "git status"
}
StatusArgs is the parsed argument set for the "status" subcommand.
func ParseStatusArgs ¶
func ParseStatusArgs(args []string) StatusArgs
ParseStatusArgs parses raw cobra args into StatusArgs.
func ParseStatusArgsWithDash ¶
func ParseStatusArgsWithDash(args []string, dashIndex int) StatusArgs
ParseStatusArgsWithDash parses args taking into account Cobra's ArgsLenAtDash().
type WorktreeAddArgs ¶ added in v0.4.0
type WorktreeAddArgs struct {
Branch string // existing branch (when NewBranch is empty) or base branch (when NewBranch is set)
NewBranch string // -b <new-branch>
}
WorktreeAddArgs is the parsed argument set for "worktree add".
func ParseWorktreeAddArgs ¶ added in v0.4.0
func ParseWorktreeAddArgs(args []string, newBranch string) (WorktreeAddArgs, error)
ParseWorktreeAddArgs parses raw cobra args and the -b flag into WorktreeAddArgs.
func (WorktreeAddArgs) TargetBranch ¶ added in v0.4.0
func (a WorktreeAddArgs) TargetBranch() string
TargetBranch returns the branch name that determines the worktree directory path.
type WorktreeListArgs ¶ added in v0.4.0
type WorktreeListArgs struct {
Patterns []string // worktree path filter regexps; empty means all
Repo bool // --repo: output unique main repository paths instead of worktree paths
All bool // -a, --all: list across all repositories instead of current repository
RepoDir string // target repo directory when All is false (defaults to cwd)
}
WorktreeListArgs is the parsed argument set for "worktree list".
func ParseWorktreeListArgs ¶ added in v0.4.0
func ParseWorktreeListArgs(args []string, repoOnly bool, all ...bool) WorktreeListArgs
ParseWorktreeListArgs parses raw cobra args and flags into WorktreeListArgs.
type WorktreePruneArgs ¶ added in v0.4.0
WorktreePruneArgs is the parsed argument set for "worktree prune".
func ParseWorktreePruneArgs ¶ added in v0.4.0
func ParseWorktreePruneArgs(args []string, dryRun, all bool) WorktreePruneArgs
ParseWorktreePruneArgs parses raw cobra args and flags into WorktreePruneArgs.
type WorktreeRemoveArgs ¶ added in v0.4.0
type WorktreeRemoveArgs struct {
Branch string
Force bool
NoForce bool
DeleteBranch bool
ForceDeleteBranch bool
}
WorktreeRemoveArgs is the parsed argument set for "worktree remove".
func ParseWorktreeRemoveArgs ¶ added in v0.4.0
func ParseWorktreeRemoveArgs(args []string, force, noForce, deleteBranch, forceDeleteBranch bool) (WorktreeRemoveArgs, error)
ParseWorktreeRemoveArgs parses raw cobra args and flags into WorktreeRemoveArgs. If forceDeleteBranch is true, Force and DeleteBranch are also set to true.