tinted-theming / tinty

A base16 and base24 color scheme manager
MIT License
31 stars 3 forks source link

feat: add completion #18

Closed henry-hsieh closed 2 months ago

henry-hsieh commented 2 months ago

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 圖片

henry-hsieh commented 2 months ago

I'm done with changes. Please go ahead.