feat(spec): support tool aliases (#107)
closes #57 IRIS now automatically read and suggest internal configuration aliases for Git (`.gitconfig`, `.git/config`) and Cargo (`.cargo/config.toml`) - Added the `Provider` interface and extended registry for CLI tools that define aliases - Git: parse aliases via `git config --show-scope`, supporting raw tab/space separation and scope differentiation - Cargo: traverse the directory tree upwards to root to read the `.cargo/config.toml` configuration - 0ms hot-path caching: key caching is calculated entirely via `os.Stat` mtime (no subprocess spawn) combined with a 2-second TTL window to ensure 0ms latency when typing - Lookup integration: display alias suggestions at the subcommand level and automatically expand aliases as the user enters further arguments (ignore shell pipeline commands starting with `!`)
This commit is contained in:
+4
-1
@@ -25,7 +25,10 @@ func MergeResults(query string, mode string) []spec.Suggestion {
|
||||
// add suggestion helper to deduplicate
|
||||
addSuggestion := func(s spec.Suggestion) {
|
||||
normalizedCmd := strings.TrimSpace(s.Cmd)
|
||||
if normalizedCmd == "" || normalizedCmd == normalizedQuery {
|
||||
if normalizedCmd == "" {
|
||||
return
|
||||
}
|
||||
if s.Source != "alias" && normalizedCmd == normalizedQuery {
|
||||
return
|
||||
}
|
||||
if s.Source == "" {
|
||||
|
||||
Reference in New Issue
Block a user