Repository navigation
Description
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
Activity
calmh commentedon Oct 22, 2022
Something could probably be added using https://github.com/WillAbides/kongplete
[-]Consider adding CLI completion (cobra?)[/-][+]Consider adding CLI completion[/+]danpadcz commentedon Oct 25, 2023
Hey there, is anybody working on this feature? If not then I would like to work on it 😄
cmd/syncthing: Add CLI completion functionality (implements syncthing…
cmd/syncthing: Add CLI completion functionality (implements syncthing…
cmd/syncthing: Add CLI completion functionality (implements syncthing…
[-]Consider adding CLI completion[/-][+]Add CLI completion[/+]Merge branch 'main' into integrationtests
cmd/syncthing: Add CLI completion functionality (fixes syncthing#8616) (
ReillyBrogan commentedon Feb 7, 2024
There doesn't seem to be any mechanism where a Linux package maintainer can generate shell completions ahead of time for supported shells. This seems to be a limitation of kongplete which only checks the users login shell to determine which shell to generate completions for (see this. Perhaps there's a different library out there that could be used instead?