Documentation ¶
Overview ¶
Package shorthand implements support for shorthand commands for the git-spice CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuiltinSource ¶
type BuiltinSource struct {
// contains filtered or unexported fields
}
BuiltinSource is a source of shorthand expansions built into a Kong CLI based on command aliases.
The shorthand for each command is built by joining the first alias at each level of the command hierarchy. For example, for:
branch (b) create (c)
The shorthand would be "bc".
func NewBuiltin ¶
func NewBuiltin(app *kong.Application) (*BuiltinSource, error)
NewBuiltin builds a new BuiltinSource from the given Kong application. It extracts the shorthands from the command aliases.
func (*BuiltinSource) ExpandShorthand ¶
func (s *BuiltinSource) ExpandShorthand(cmd string) ([]string, bool)
ExpandShorthand expands the given shorthand command.
type Source ¶
type Source interface { // ExpandShorthand expands the given shorthand command // into a list of arguments. // // If the command is not a shorthand, it returns false. ExpandShorthand(string) ([]string, bool) }
Source is a source of shorthand expansions.
Click to show internal directories.
Click to hide internal directories.