Files
iris-context/root/mock_git_provider_test.go
T
VERSE 6faa2e3274 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 `!`)
2026-08-02 14:30:46 +07:00

11 lines
307 B
Go

package root
import "github.com/versenilvis/iris/spec/alias"
type mockGitProvider struct{}
func (m *mockGitProvider) ToolName() string { return "git" }
func (m *mockGitProvider) GetAliases(cwd string) []alias.AliasEntry {
return []alias.AliasEntry{{Name: "co", Expansion: "checkout", Scope: "local"}}
}