Documentation
¶
Index ¶
- Variables
- func CommandNotFound(_ context.Context, cmd *cli.Command, command string)
- func GetFormat(ctx context.Context, cmd *cli.Command) string
- func HasExplicitInput(cmd *cli.Command) bool
- func NoArgs(action cli.ActionFunc) cli.ActionFunc
- func ResolveWorkspace(ctx context.Context, cmd *cli.Command) (string, error)
- func ResolveWorkspaceAndRepo(ctx context.Context, cmd *cli.Command) (string, string, error)
- func WithFactory(ctx context.Context, f *Factory) context.Context
- type Factory
Constants ¶
This section is empty.
Variables ¶
var ErrShowedUsage = errors.New("showed usage")
ErrShowedUsage is returned when command help was displayed instead of an error.
var FormatFlag = &cli.StringFlag{
Name: "format",
Usage: "Output format: table, json",
Value: "table",
}
FormatFlag is the --format flag.
var LimitFlag = &cli.IntFlag{
Name: "limit",
Usage: "Maximum number of results",
Value: 30,
}
LimitFlag is the --limit flag.
var RepoFlag = &cli.StringFlag{ Name: "repo", Aliases: []string{"r"}, Usage: "Repository slug", }
RepoFlag is the --repo / -r flag.
var WebFlag = &cli.BoolFlag{
Name: "web",
Usage: "Open in browser",
}
WebFlag is the --web flag.
var WorkspaceFlag = &cli.StringFlag{ Name: "workspace", Aliases: []string{"w"}, Usage: "Bitbucket workspace slug", }
WorkspaceFlag is the --workspace / -w flag.
Functions ¶
func CommandNotFound ¶ added in v0.0.6
CommandNotFound is a shared handler for unknown subcommands. It prints an error message, suggests a similar command, and lists available commands.
func HasExplicitInput ¶
HasExplicitInput returns true if the user explicitly set any flag or provided any positional args.
func NoArgs ¶
func NoArgs(action cli.ActionFunc) cli.ActionFunc
NoArgs wraps an action to reject unknown positional arguments on leaf commands.
func ResolveWorkspace ¶
ResolveWorkspace resolves just the workspace (for commands that don't need a repo).
func ResolveWorkspaceAndRepo ¶
ResolveWorkspaceAndRepo resolves workspace and repo from flags, git remote, or config.
Types ¶
type Factory ¶
Factory holds shared dependencies for commands.
func GetFactory ¶
GetFactory retrieves the factory from the context.
func NewFactory ¶
NewFactory creates a new Factory with default values.