Skip to content

Commit

Permalink
steamguard-cli: add shell completions
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiejet committed Dec 2, 2023
1 parent 4437b4d commit c2df2b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions srcpkgs/steamguard-cli/template
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@ pkgname=steamguard-cli
version=0.12.3
revision=1
build_style=cargo
build_helper=qemu
hostmakedepends="pkg-config"
short_desc="Utility for Steam 2FA and for managing trade confirmations"
maintainer="Filip Rojek <filip@filiprojek.cz>"
license="GPL-3.0-only"
homepage="https://github.com/dyc3/steamguard-cli"
distfiles="https://github.com/dyc3/steamguard-cli/archive/v${version}/steamguard-cli-${version}.tar.gz"
checksum=ab61be79e595611d39558af38f3708c9212de687c68ec314e683faeca8bfb3e3
_completions="bash zsh fish"

post_install() {
local bin=${DESTDIR}/usr/bin/steamguard
for shell in ${_completions}; do
vtargetrun ${bin} completion --shell ${shell} > completion.${shell}
vcompletion completion.${shell} ${shell}
done
}

4 comments on commit c2df2b9

@filiprojek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'm not sure if this is the correct way to add completions. I've tried to install it with your additions on my machine, but it seems to not work. What could I miss? Otherwise, I would like to add your changes to my branch.

@rookiejet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! I did not test it for shells other than zsh so I didn't catch this, sorry. For bash completion the file needs to have the same name as the command I think, which is probably why vcompletion has an optional command name argument (the installed completion defaults to package name if omitted), while for zsh it doesn't seem to be a requirement (not sure about fish shell).

vcompletion completion.${shell} ${shell} steamguard should be the correct command, I'll amend my commit. Thank you for following up on this.

@rookiejet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New commit: dab9a00

@filiprojek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, the package is now merged into master. Thanks for the contribution.

Please sign in to comment.