Re:Writing Your Own Simple Tab-Completions for Bash and Zsh
by cb321 on Sunday August 10, 2025 @08:43AM
(#44854808)
For those programs that have betrayed shipping man pages, instead say relying only on a --help system, do you happen to know if the fish shell has an analogue to Zsh `_gnu_generic` and Bash `complete -F _longopt`? If not, do you have any insight into why not/what it would take to make that happen?
[ Parent
| on HN ]
Re:Writing Your Own Simple Tab-Completions for Bash and Zsh
by mr_mitm on Sunday August 10, 2025 @09:39AM
(#44855124)
At least for a subset of Python CLI programs, I wrote this: https://github.com/AdrianVollmer/pycompgen
Still in an early stage, but it should work.
Re:Writing Your Own Simple Tab-Completions for Bash and Zsh
by nikita2206 on Sunday August 10, 2025 @09:04AM
(#44854915)
The OP mentions them in the last part of their comment, there is `complete …` commands for registering completions
Re:Writing Your Own Simple Tab-Completions for Bash and Zsh
by cb321 on Sunday August 10, 2025 @09:16AM
(#44854995)
It sounds like you don't know how the Bash/Zsh ideas I mentioned work. They run the command with --help, parse the output, and from that generate the completions, wiring them in to the completion system. That method is a zero config solution (well, you might need a list of such "command-names only" - no option names, which could change at any time -- so maybe "minimal config"). The OP & you mention a much heavier config solution which strikes me as against the vibe of Fish in general which is, supposedly, out-of-the-box niceness.