wakatime-cli icon indicating copy to clipboard operation
wakatime-cli copied to clipboard

shell completion

Open Freed-Wu opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

Is wakatime/wakatime-cli possible to provide tab completion for common shells like

❯ wakatime --<TAB>
option
--alternate-branch                 Optional alternate branch name. Auto-detected branch takes priority.
--alternate-language               Optional alternate language name. Auto-detected language takes priority.
--alternate-project                Optional alternate project name. Auto-detected project takes priority.
--api-url                          API base url used when sending heartbeats and fetching code stats. Defaults to https-//api.wakatime.com/api/v1/.
--category                         Category of this heartbeat activity. Can be "coding", "building", "indexing", "debugging", "running tests", "writing tests", "manual testing", "code reviewing", "browsing", or "designing". Defaults to "coding".
--config                           Optional config file. Defaults to '~/.wakatime.cfg'.
--config-read                      Prints value for the given config key, then exits.
--config-section                   Optional config section when reading or writing a config key. Defaults to (settings). (default "settings")
--config-write                     Writes value to a config key, then exits. Expects two arguments, key and value. (default ())
--cursorpos                        Optional cursor position in the current file.
--disable-offline                  Disables offline time logging instead of queuing logged time.
--entity                           Absolute path to file for the heartbeat. Can also be a url, domain or app when --entity-type is not file.
...

Describe the solution you'd like to see

https://jmtirado.net/shell-completion-with-cobra-and-go/

Describe alternatives you've considered

https://github.com/cli/cli/blob/cf4b73ff958b272cf3c9c0cf9351459f76b793a0/pkg/cmd/completion/completion.go

Additional context

Freed-Wu avatar Jan 11 '23 16:01 Freed-Wu