Documentation
¶
Overview ¶
Package command provides CLI commands for the jay application.
Package command provides CLI commands for the jay application.
Index ¶
- Constants
- Variables
- func Execute() error
- func ResolveSubscription(flag string) (enums.Subscription, error)
- type Bootstrap
- type ConfigInfo
- type ConfigureOptionFn
- type ConfigureOptions
- type Jabber
- type LocaleDetector
- type RootParameterSet
- type RunInputs
- type RunParameterSet
- type SharedFamilies
- type WalkInputs
- type WalkParameterSet
Constants ¶
const ( AppEmoji = "🍒" ApplicationName = "jay" SourceID = "github.com/snivilised/jaywalk/src/agenor" )
const ( // root RootPsName = "root-ps" // shared families (registered on root, inherited by sub-commands) PreviewFamName = "preview-fam" CascadeFamName = "cascade-fam" InteractionFamName = "interaction-fam" SamplingFamName = "sampling-fam" // run-only family WorkerPoolFamName = "worker-pool-fam" // filter family (registered per-command, not inherited) PolyFamName = "poly-fam" // jay-specific param sets WalkPsName = "walk-ps" RunPsName = "run-ps" )
const ( ResumeStrategySpawn = "spawn" ResumeStrategyFastward = "fastward" )
const ( // SubscribeFlagFiles subscribes to file nodes only. SubscribeFlagFiles = "files" // SubscribeFlagDirs subscribes to directory nodes only. SubscribeFlagDirs = "dirs" // SubscribeFlagAll subscribes to all nodes (files and directories). SubscribeFlagAll = "all" // SubscribeFlagDefault is the default subscription if not specified. SubscribeFlagDefault = SubscribeFlagAll )
Variables ¶
var (
Version = strings.TrimSpace(version)
)
TODO: The version.txt should be updated in ci to contain the version number associated with the applied tag. Currently not yet defined in this template.
Functions ¶
func ResolveSubscription ¶
func ResolveSubscription(flag string) (enums.Subscription, error)
ResolveSubscription maps the user-supplied --subscribe string to the corresponding agenor enums.Subscription value. Returns an error if the value is not one of the three legal strings.
Types ¶
type Bootstrap ¶
type Bootstrap struct {
// Cfg is populated after configure() reads viper.
Cfg *cfg.Config
// UI is constructed from the --tui flag value in PersistentPreRunE
// and injected into every command's Inputs struct.
UI ui.Manager
// contains filtered or unexported fields
}
Bootstrap constructs the full cobra command tree and owns all mamba param-set registrations. It is the single entry point for application startup wiring.
type ConfigInfo ¶
type ConfigInfo struct {
Name string
ConfigType string
ConfigPath string
Viper macfg.ViperConfig
}
ConfigInfo describes the configuration file that should be loaded, including its name, type, path and the viper instance to use.
type ConfigureOptionFn ¶
type ConfigureOptionFn func(*ConfigureOptions)
ConfigureOptionFn is a functional option used to modify ConfigureOptions before Bootstrap performs its setup.
type ConfigureOptions ¶
type ConfigureOptions struct {
Detector LocaleDetector
Config ConfigInfo
}
ConfigureOptions groups configuration options that influence how Bootstrap initialises localisation and configuration.
type LocaleDetector ¶
LocaleDetector abstracts the detection of the user's preferred language as a BCP 47 language tag.
type RootParameterSet ¶
type RootParameterSet struct {
store.ParameterSetWithOverrides
// Language sets the IETF BCP 47 language tag for i18n output.
Language string
// TUI selects the display mode. Corresponds to --tui <mode>.
// Defaults to "linear" (plain fmt.Println output).
// Future values: "flashy", "retro", etc (Charm-based implementations).
TUI string
}
RootParameterSet holds flags defined on the root command that are inherited by all sub-commands.
type RunInputs ¶
type RunInputs struct {
// Tree is the positional directory argument.
Tree string
// UI is the display manager selected by --tui. All output to the
// terminal is routed through this interface.
UI ui.Manager
// Jay-specific flags
ParamSet *assist.ParamSet[RunParameterSet]
// Per-command filter family (not inherited from root)
PolyFam *assist.ParamSet[store.PolyFilterParameterSet]
// Run-only family
WorkerPool *assist.ParamSet[store.WorkerPoolParameterSet]
}
RunInputs collects all flag values needed to build a Run invocation.
type RunParameterSet ¶
type RunParameterSet struct {
store.ParameterSetWithOverrides
// Subscribe controls which node types are visited.
// Valid values: "files", "dirs", "all". Maps to --subscribe(-s).
Subscribe string
// Action names the config-defined action to invoke for each node.
// Maps to --action(-a).
Action string
// Pipeline names the config-defined pipeline to execute.
// Maps to --pipeline(-p).
Pipeline string
// Resume defines the resume strategy to use when re-entering a
// previously interrupted traversal. Maps to --resume(-r).
// Valid values: "spawn", "fastward". Empty means prime (no resume).
Resume string
}
RunParameterSet holds the jay-specific flags for the run command. It mirrors WalkParameterSet; run additionally gets WorkerPoolParameterSet via a separate family registration.
type SharedFamilies ¶
type SharedFamilies struct {
}
SharedFamilies groups the mamba param-set pointers registered on the root command as persistent flags, inherited by all sub-commands. Note: CliInteractionParameterSet is NOT included here because --tui is a string flag on RootParameterSet, allowing the user to select a named display mode rather than a simple on/off boolean.
type WalkInputs ¶
type WalkInputs struct {
// Tree is the positional directory argument.
Tree string
// UI is the display manager selected by --tui. All output to the
// terminal is routed through this interface.
UI ui.Manager
// Jay-specific flags
ParamSet *assist.ParamSet[WalkParameterSet]
// Per-command filter family (not inherited from root)
PolyFam *assist.ParamSet[store.PolyFilterParameterSet]
}
WalkInputs collects all flag values needed to build a Walk invocation.
type WalkParameterSet ¶
type WalkParameterSet struct {
store.ParameterSetWithOverrides
// Subscribe controls which node types are visited.
// Valid values: "files", "dirs", "all". Maps to --subscribe(-s).
Subscribe string
// Action names the config-defined action to invoke for each node.
// Maps to --action(-a).
Action string
// Pipeline names the config-defined pipeline to execute.
// Maps to --pipeline(-p).
Pipeline string
// Resume defines the resume strategy to use when re-entering a
// previously interrupted traversal. Maps to --resume(-r).
// Valid values: "spawn", "fastward". Empty means prime (no resume).
Resume string
}
WalkParameterSet holds the jay-specific flags for the walk command. Shared families (preview, cascade, sampling, poly-filter) are registered separately and are not embedded here.