AuHau / toggl-cli

A simple command-line interface for toggl.com

Home Page:https://toggl.uhlir.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install completion to $ZDOTDIR/.zshrc

jakkdl opened this issue · comments

very minor, but completions are installed to ~/.zshrc instead of $ZDOTDIR/.zshrc where my .zshrc actually lives.

Thanks for reporting, although this behavior comes from upstream dependency: https://github.com/click-contrib/click-completion

That said not even sure if that is the suggested method how to implement completions anymore as Click 8.x now ships its own mechanism for completions, but I don't have time to really investigate nor migrate to this new mechanism. If you would like to take a bite at it, then feel free!

ye not sure it even works for me at all. I might look at it if I find some free time :)

So as I understand the relevant bit of Click's docs, they only generate the file now, they don't really provide any support for shell config file modification. Which I guess makes a lot of sense, honestly.

I guess we could easily migrate to the new way of doing things by dropping the toggl config completion feature and instead adding the following to the docs, here for zsh:

Save the script somewhere.

_FOO_BAR_COMPLETE=zsh_source toggl > ~/.toggl-complete.zsh

Source the file in ~/.zshrc.

. ~/.toggl-complete.zsh

I wonder whether there's a simple way to keep the config completion functionality.

We should probably close this in favor of #214, actually. Since this way of providing completion is outdated, it doesn't help much to keep relying on click_completion in perpetuity. 🙁