Documentation
¶
Overview ¶
Package discover provides command discovery and auto-rewrite functionality. This package implements RTK-style command rewriting for transparent tokman integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectCommand ¶ added in v0.28.0
DetectCommand detects if a command is known and can be rewritten.
func GetCacheStats ¶ added in v0.28.0
func GetCacheStats() (hits, misses int64)
GetCacheStats returns cache hit/miss statistics
func KnownCommands ¶ added in v0.28.0
func KnownCommands() []string
KnownCommands returns list of known command patterns.
func RewriteCommand ¶
RewriteCommand rewrites a command using tokman equivalents (RTK-style). Returns the rewritten command and true if a rewrite occurred. Results are cached for performance.
func ShouldRewriteFile ¶ added in v0.28.0
ShouldRewriteFile checks if a file should trigger rewrite detection
Types ¶
type CommandPattern ¶ added in v0.28.0
type CommandPattern struct {
Name string
Pattern *regexp.Regexp
Rewrite string
Description string
Priority int // Higher priority patterns are checked first
}
CommandPattern defines a command pattern for rewriting
type RewriteOptions ¶ added in v0.28.0
type RewriteOptions struct {
// DisableTestRunner disables automatic test-runner detection
DisableTestRunner bool
// PreferExplicit prefers explicit tokman commands over test-runner
PreferExplicit bool
// DisableCache disables caching for this rewrite
DisableCache bool
}
RewriteOptions provides options for command rewriting