Documentation
¶
Index ¶
Constants ¶
View Source
const ( Self = "self" CommandUpdate = "update" CommandUninstall = "uninstall" CommandVersion = "version" CommandHelp = "help" )
Variables ¶
View Source
var ErrNotSelfCommand = errors.New("not a self command")
ErrNotSelfCommand is returned when the command is not a self command.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App represents the main app.
func (*App) IsInternalCall ¶
IsInternalCall checks if the hook is being called internally (either via test or zsh script).
type GitHelper ¶
type GitHelper interface { GetCurrentGitRef() (string, error) GetRepoGitDir() (string, error) GitRun(subCmd string, args ...string) error GitOutput(subCmd string, args ...string) (string, error) }
GitHelper provides methods for reading git references.
type SelfController ¶ added in v0.1.1
type SelfController struct {
// contains filtered or unexported fields
}
SelfController handles self-management commands that don't require a git repository.
func NewSelfController ¶ added in v0.1.1
func NewSelfController(buildVersion string, verbose bool) *SelfController
NewSelfController creates a new SelfController instance.
func (*SelfController) AddScript ¶ added in v0.1.1
func (sc *SelfController) AddScript(cmdName, script string) *SelfController
func (*SelfController) ExtractSelfCommand ¶ added in v0.1.1
func (sc *SelfController) ExtractSelfCommand(args []string) string
ExtractSelfCommand checks if the given arguments represent a self-management command.
func (*SelfController) HandleSelfCommand ¶ added in v0.1.1
func (sc *SelfController) HandleSelfCommand(args []string) error
HandleSelfCommand processes self-management commands and returns true if handled. Returns (handled, error) where handled indicates if the command was a self command.
Click to show internal directories.
Click to hide internal directories.