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

Rework CLI completion with new Click 8.0 release

AuHau opened this issue · comments

The new Click 8.0 release has rewritten the tab completion system and now for one includes native support and for two it has more capabilities which for example could be used to complete name of entities in flags like --project etc.

I don't have time at the moment to work on this, but if anybody would be interested PR would be welcomed!

Crossposting from #271 (comment)_

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.