Skip to content

Add CLI completion #8616

@lwbt

Description

@lwbt

Hello, I recently found out that many Go projects use https://github.com/spf13/cobra which among other features offers command completion for a wide variety of shells without writing separate completers. I thought it was a de-facto standard until I noticed that the first Go program I ever started to use (Syncthing) and am very happy with, except with its CLI, had no command completion.

Would that be a big refactoring of code?

What problem your new feature would solve

Making options, parameters and help more accessible on the command line.

How or why you think it is generally useful (i.e., not just for you)

To my experience command completion that "just works" is understood by many and makes applications easier to use without jumping back and forth between manpages or --help or just make it easier to discover options and that --help isn't just available at the top level. While many Syncthing users mostly use the Web GUI, the product may benefit from having command completion, particularly when considering features like decryption of folders.

What alternatives or workarounds you considered

  • Writing completers for Bash while starting at with minimal knowledge about how completers work and how to write good completers and keep them in sync with upstream.
  • Writing more scripts to workaround usability issues which I see solved in other projects like kubectl/chezmoi through helpful completers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions