47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.5 KiB
1.5 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path, source_repo, source_license, source_file
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | source_repo | source_license | source_file | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| read_dir_autocomplete | function | go | tui | 1.0.0 | impure | func ReadDirAutocomplete(searchDir, prefix string) ([]AutocompleteCandidate, error) | Lee entradas de un directorio filtradas por prefijo (case-insensitive). Retorna candidatos ordenados por nombre, utiles para autocompletado de rutas en TUIs. |
|
false | error_go_core |
|
|
slice de AutocompleteCandidate con Name y IsDir, ordenados alfabeticamente | false | functions/tui/read_dir_autocomplete.go | https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/egutierrez/DevLauncher.git | MIT | launcher/middleware/command_fs.go |
Ejemplo
candidates, err := tui.ReadDirAutocomplete("/home/user", "doc")
// candidates podria ser: [{Name:"Documents" IsDir:true}, {Name:"docker-compose.yml" IsDir:false}]
// Sin prefijo retorna todas las entradas
all, _ := tui.ReadDirAutocomplete("/tmp", "")
Notas
El struct AutocompleteCandidate se define en el mismo archivo. El campo IsDir permite al caller diferenciar directorios de archivos para renderizar iconos o sufijos distintos.