clifactory

package
v0.0.0-...-8f0f526 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package clifactory provides shared CLI infrastructure for lore and writ.

Index

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 CacheHome

func CacheHome() string

CacheHome returns XDG_CACHE_HOME or ~/.cache

func ConfigHome

func ConfigHome() string

ConfigHome returns XDG_CONFIG_HOME or ~/.config

func DataHome

func DataHome() string

DataHome returns XDG_DATA_HOME or ~/.local/share

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

func NewCompletionCmd(rootCmd *cobra.Command) *cobra.Command

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

func NewManCmd(rootCmd *cobra.Command, header ManHeader) *cobra.Command

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 StateHome

func StateHome() string

StateHome returns XDG_STATE_HOME or ~/.local/state

func ZshCompletionPath

func ZshCompletionPath() string

ZshCompletionPath returns the zsh completion directory. XDG_DATA_HOME/zsh/site-functions

Types

type ManHeader

type ManHeader struct {
	Title   string
	Section string
	Source  string
	Manual  string
}

ManHeader contains metadata for man page generation.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL