baptistemehat / forest

A terminal-based project manager
GNU General Public License v3.0
1 stars 0 forks source link

Add completion #14

Open baptistemehat opened 1 month ago

baptistemehat commented 1 month ago

Investigate how to add completion to the app for completing:

baptistemehat commented 1 month ago

For zsh completion https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide

baptistemehat commented 1 month ago

Status

clap enables developpers to generate static completions at build time such as

forest <tab> 
task tree note switch ...

but for now, it does not provide ant way to generate dynamic completion functions (ie, retrieving task and note ids for completion) at build time:

forest note edit <tab>
099cc8   #my note
922aaf   # another note
...

What to do

From there I see two options:

baptistemehat commented 1 month ago

Here is what just does:

baptistemehat commented 1 month ago

Plan

For now, add the basic static buildtime-generated completions alongside the binary. Dynamic completion can wait.