kongplete icon indicating copy to clipboard operation
kongplete copied to clipboard

add --shell parameter

Open charlesdaniels opened this issue 3 years ago • 2 comments

This allows the user of the install-completions subcommand to override the detected shell and explicitly use one of the 3 supported options.

I also removed the Uninstall field from the subcommand, because unused.

charlesdaniels avatar Feb 22 '23 04:02 charlesdaniels

@WillAbides @charlesdaniels could we get this PR rebased and merged? I came here because syncthing recently added completions using this library, and as a Linux distribution package maintainer I want to generate all shell completions during the package build so that they work out-of-the-box when a user installs the package. This doesn't seem to be possible using this library without modifying the build users login shell which is often impossible in build environments due to sandboxing constraints.

Frankly, checking for the login shell is a bad choice for detection on Linux. It would be far more idiomatic to check the SHELL environmental variable which should always contain the value of the current shell. Otherwise a user could have fish as their login shell and start a bash shell and the generated completions wouldn't work with bash.

ReillyBrogan avatar Feb 07 '24 21:02 ReillyBrogan

Totally forgot about this, I never got a PR review. I would be happy to rebase this and address any feedback if @WillAbides is interested in having this merged.

charlesdaniels avatar Feb 07 '24 21:02 charlesdaniels