Documentation
¶
Overview ¶
Package cli defines the cobra command tree for the dp CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "" Commit = "" )
Version and Commit are set at build time via -ldflags.
go build -ldflags "-X github.com/scbrown/desire-path/internal/cli.Version=v0.2.0 -X github.com/scbrown/desire-path/internal/cli.Commit=48cae1d"
Functions ¶
Types ¶
type AliasCollection ¶
type AliasCollection struct {
Meta CollectionMeta `json:"meta" toml:"meta"`
Aliases []ExportedAlias `json:"aliases" toml:"aliases"`
}
AliasCollection is the portable interchange format for aliases.
type CollectionMeta ¶
type CollectionMeta struct {
Version int `json:"version" toml:"version"`
Name string `json:"name,omitempty" toml:"name,omitempty"`
Description string `json:"description,omitempty" toml:"description,omitempty"`
Author string `json:"author,omitempty" toml:"author,omitempty"`
ExportedAt time.Time `json:"exported_at" toml:"exported_at"`
Source string `json:"source,omitempty" toml:"source,omitempty"`
Count int `json:"count" toml:"count"`
}
CollectionMeta holds metadata about an alias collection.
type EnvNeed ¶
type EnvNeed struct {
Command string `json:"command"`
Count int `json:"count"`
LastError string `json:"last_error"`
}
EnvNeed represents an aggregated missing-command need.
type ExportedAlias ¶
type ExportedAlias struct {
From string `json:"from" toml:"from"`
To string `json:"to" toml:"to"`
Tool string `json:"tool,omitempty" toml:"tool,omitempty"`
Param string `json:"param,omitempty" toml:"param,omitempty"`
Command string `json:"command,omitempty" toml:"command,omitempty"`
MatchKind string `json:"match_kind,omitempty" toml:"match_kind,omitempty"`
Message string `json:"message,omitempty" toml:"message,omitempty"`
}
ExportedAlias is the portable representation of an alias. CreatedAt is omitted — it gets set on import.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table writes column-aligned output using text/tabwriter with consistent formatting across all commands. Headers are bold when output is a TTY.
func NewTable ¶
NewTable creates a Table that writes to w. If headers are provided, they are written as a bold header row (bold only when w is a TTY).