This PR uses clap_complete to generate the completion script. To generate the completion script, use tinty --generate SHELL > script_path.
The reason why I added generated complete scripts to the Git index is that I want the schemes can be selected in completion directly. Currently, clap_complete cannot generate the complete results dynamically based on the outcome of another command, just like tinty apply $(tinty list | fzf) trick. Therefore, I have to manually change some places of the generated scripts.
However, I only make changes on bash only. The zsh, fish, and ps1 are untouched in this commit.
Here is the sample after source tinty.bash and hit Tab for completion:
Using FZF Tab Completion
This PR uses clap_complete to generate the completion script. To generate the completion script, use
tinty --generate SHELL > script_path
.The reason why I added generated complete scripts to the Git index is that I want the schemes can be selected in completion directly. Currently, clap_complete cannot generate the complete results dynamically based on the outcome of another command, just like
tinty apply $(tinty list | fzf)
trick. Therefore, I have to manually change some places of the generated scripts.However, I only make changes on bash only. The zsh, fish, and ps1 are untouched in this commit.
Here is the sample after
Using FZF Tab Completion
![圖片](https://github.com/tinted-theming/tinty/assets/22725367/4c3dcf0f-236a-4117-9f82-e3acc91bddaa)
source tinty.bash
and hit Tab for completion: