Documentation
¶
Overview ¶
Package clifactory provides shared CLI infrastructure for lore and writ.
Index ¶
- func BashCompletionPath() string
- func CacheHome() string
- func ConfigHome() string
- func DataHome() string
- func FishCompletionPath() string
- func ManPath() string
- func NewCompletionCmd(rootCmd *cobra.Command) *cobra.Command
- func NewManCmd(rootCmd *cobra.Command, header ManHeader) *cobra.Command
- func NewVersionCmd(info VersionInfo) *cobra.Command
- func StateHome() string
- func ZshCompletionPath() string
- type ManHeader
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BashCompletionPath ¶
func BashCompletionPath() string
BashCompletionPath returns the bash completion directory. XDG_DATA_HOME/bash-completion/completions
func FishCompletionPath ¶
func FishCompletionPath() string
FishCompletionPath returns the fish completion directory. XDG_CONFIG_HOME/fish/completions
func ManPath ¶
func ManPath() string
ManPath returns the user man page directory: XDG_DATA_HOME/man/man1
func NewCompletionCmd ¶
NewCompletionCmd creates the completion command for shell completions. Usage:
tool completion bash # output to stdout tool completion bash --install # install to XDG_DATA_HOME eval "$(tool completion bash)"
func NewManCmd ¶
NewManCmd creates the man command for displaying/installing man pages. Usage:
tool man # display man page with pager tool man --install # install to ~/.local/share/man/man1/ tool man deploy # display man page for subcommand
func NewVersionCmd ¶
func NewVersionCmd(info VersionInfo) *cobra.Command
NewVersionCmd creates the version command.
func ZshCompletionPath ¶
func ZshCompletionPath() string
ZshCompletionPath returns the zsh completion directory. XDG_DATA_HOME/zsh/site-functions
Types ¶
type VersionInfo ¶
type VersionInfo struct {
Version string // Semantic version (e.g., "0.1.0")
Commit string // Git commit hash
BuildDate string // Build timestamp
}
VersionInfo contains version metadata set at build time.