Documentation
¶
Overview ¶
Package cli wires CLI subcommands to the store and clipboard.
The router is intentionally tiny: cmd/pe/main.go calls Run(args) and returns its exit code. Everything else lives behind testable methods on App so we can inject a temp store path and a fake clipboard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "(devel)"
Version is set by main at startup (which itself receives a value from goreleaser's -ldflags "-X main.version=..."). Tests and stand-alone imports of this package see the placeholder.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Path string // snippet file path; "" → store.DefaultPath()
Out io.Writer // stdout; nil → os.Stdout
Err io.Writer // stderr; nil → os.Stderr
Copy func(string) error // clipboard sink; nil → clip.Copy
Now func() time.Time // clock; nil → time.Now
}
App holds CLI dependencies. Zero value uses real defaults; tests override Path / Out / Err / Copy / Now.
Click to show internal directories.
Click to hide internal directories.