fastfetch-cli / fastfetch

A maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
10.47k stars 405 forks source link

[FEAT] Please add completion for zsh #1197

Closed AtifChy closed 2 months ago

AtifChy commented 2 months ago

Be sure to read FAQ before submitting a new issue.

Wanted features:

fastfetch has a vast number of options available, it would be much easier to traverse around these options with tab completion instead of opening the man page over and over.

Motivation:

currently fastfetch has completion support for fish shell with proper description beside each option, having the same completion with zsh would be awesome.

CarterLi commented 2 months ago

You can try carapace-bin https://github.com/carapace-sh/carapace-bin

AtifChy commented 2 months ago

@CarterLi i noticed that a python script being used to generate the completions for fish shell, can't the same be done for zsh. carapace-bin looks interesting, but i would prefer native shell completion.

CarterLi commented 2 months ago

i noticed that a python script being used to generate the completions for fish shell, can't the same be done for zsh

You still need to know the syntax of zsh script to generate the completions.

You can try it yourself if you have interest. fastfetch --help-raw prints a JSON document that contains all command line options. All you need to do is parse the JSON document and generate zsh completion command with it.

Otherwise you have to wait other people to contribute.

aymen-3 commented 2 months ago

Since fastfetch has a --help option, you can add this line to your .zshrc file and it will have completion:

compdef _gnu_generic fastfetch

CarterLi commented 2 months ago

Since fastfetch has a --help option, you can add this line to your .zshrc file and it will have completion:

compdef _gnu_generic fastfetch

No. It doesn't work.