- macOS, Linux badge and AI suggestions showcase in README - Update user guide and docs for development
1.2 KiB
1.2 KiB
Dynamic file suggestion generator (spec/filegen.go)
The FileGenerator is a dynamic suggestion engine bridging static command specs with your live filesystem.
How it works
The generator is assigned to commands or options expecting file path arguments (e.g. cat, go run).
Path resolution
Handles both local and nested paths:
cat m-> Scans./for entries starting withm.cat src/-> Scanssrc/for all entries.cat src/main-> Scanssrc/for entries starting withmain.
Intelligence features
- Extension filtering: Restricts the generator to specific file extensions (e.g.
FileGenerator(".go")forgo build). - Directory suffixing: When a directory is suggested, Iris appends
/without an extra trailing space, allowing continuous folder traversal. - Descriptions: Converts file extensions into human-readable labels (e.g.
.mp4->video,.zip->archive). - Directory-only mode: Commands like
cdfilter out files to display directories only.
Code example
// registration for 'go run'
Generator: spec.FileGenerator(".go")
When typing go run , Iris scans the target directory, filters for .go extensions, and ignores unrelated binaries or assets.