diff options
author | Frederik “Freso” S. Olesen | 2024-04-29 01:15:30 +0200 |
---|---|---|
committer | Frederik “Freso” S. Olesen | 2024-04-29 01:15:30 +0200 |
commit | fb351707abd88597d6ef317d13895bea778023d2 (patch) | |
tree | 02163443d260db9a547db360dd8990a35fff3d14 | |
parent | 0bbdf6d1f754a536aca84b7ad45f3ac6bb0901f8 (diff) | |
download | aur-twitch-dl.tar.gz |
Generate and install shell completion files
Reference:
https://twitch-dl.bezdomni.net/shell_completion.html
https://click.palletsprojects.com/en/8.1.x/shell-completion/#enabling-completion
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 16 |
2 files changed, 16 insertions, 2 deletions
@@ -1,7 +1,7 @@ pkgbase = twitch-dl pkgdesc = Twitch video downloader that use multiple concurrent connections pkgver = 2.3.0 - pkgrel = 7 + pkgrel = 8 url = https://github.com/ihabunek/twitch-dl arch = any license = GPL3 @@ -3,7 +3,7 @@ pkgname=twitch-dl pkgver=2.3.0 -pkgrel=7 +pkgrel=8 pkgdesc="Twitch video downloader that use multiple concurrent connections" arch=('any') url="https://github.com/ihabunek/twitch-dl" @@ -42,6 +42,17 @@ build() { export PYTHONPATH="$PWD/build/lib" make man docs + + # Make ad hoc `twitch-dl` script + echo '#!'$(which python) > twitch-dl + cat build/lib/twitchdl/__main__.py >> twitch-dl + chmod +x twitch-dl + + # Generate completion files + _shells=(bash fish zsh) + for _shell in "${_shells[@]}"; do + _TWITCH_DL_COMPLETE="${_shell}_source" ./twitch-dl > "$pkgname.${_shell}" + done } check() { @@ -56,4 +67,7 @@ package() { install -Dm644 twitch-dl.1.man "$pkgdir"/usr/share/man/man1/twitch-dl.1 install -Dm644 -t "$pkgdir"/usr/share/doc/"$pkgname" {CHANGELOG,TODO,README}.md mv book "$pkgdir"/usr/share/doc/"$pkgname"/ + install -Dm644 -t "$pkgdir"/usr/share/fish/vendor_completions.d "$pkgname".fish + install -Dm644 -T "$pkgname".bash "$pkgdir"/usr/share/bash-completion/completions/"$pkgname" + install -Dm644 -T "$pkgname".zsh "$pkgdir"/usr/share/zsh/site-functions/_"$pkgname" } |