Documentation
¶
Index ¶
- Constants
- Variables
- func CanonizeExecutablePath(name, workDir, pathVar, homeDir string) (canonized string, err error)
- func CheckExecutablePath(executablePath string) error
- func CheckHelpPage(helpPage *HelpPage) (err error)
- func IsCommandMatchingContext(command []string, context FlagContext) bool
- type AddHelpPageStatus
- type Command
- type Completion
- type FlagContext
- type HelpPage
- type Policy
- type Storage
Constants ¶
View Source
const ( PolicyUnknown = Policy("") PolicyAsk = Policy("ask") PolicyTrust = Policy("trust") PolicyIgnore = Policy("ignore") )
View Source
const ( AddHelpPageStatusNew = AddHelpPageStatus("new") AddHelpPageStatusUpdated = AddHelpPageStatus("updated") )
Variables ¶
View Source
var CurrentSchemaVersion = 1
View Source
var (
ErrAppPathIsEmpty = fmt.Errorf("executable path cannot be empty")
)
Functions ¶
func CanonizeExecutablePath ¶
func CheckExecutablePath ¶
func CheckHelpPage ¶
func IsCommandMatchingContext ¶
func IsCommandMatchingContext(command []string, context FlagContext) bool
Types ¶
type AddHelpPageStatus ¶
type AddHelpPageStatus string
type Completion ¶
type Completion struct {
Flag string
Context FlagContext
}
type FlagContext ¶
type HelpPage ¶
type HelpPage struct {
ExecutablePath string
Completions []Completion
CheckSum string
Command Command
}
type Storage ¶
type Storage interface {
GetCommandPolicy(args []string) (policy Policy, err error)
GetAllCompletions() (pages []HelpPage, err error)
GetCompletions(path string) (completions []Completion, err error)
AddHelpPage(helpPage *HelpPage, policy Policy) (status AddHelpPageStatus, err error)
// NB. This command might return null pointers in case some help page is broken.
ListCommands() (result map[int64]*Command, err error)
RemoveHelpPage(commandId int64) (path string, err error)
Close() error
}
func NewSqliteStorage ¶
Click to show internal directories.
Click to hide internal directories.