* [PR PATCH] tea: add shell completion scripts
@ 2022-08-10 20:44 tranzystorek-io
2022-08-11 6:53 ` [PR PATCH] [Merged]: " classabbyamp
0 siblings, 1 reply; 2+ messages in thread
From: tranzystorek-io @ 2022-08-10 20:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]
There is a new pull request by tranzystorek-io against master on the void-packages repository
https://github.com/tranzystorek-io/void-packages tea-completion
https://github.com/void-linux/void-packages/pull/38591
tea: add shell completion scripts
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/38591.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-tea-completion-38591.patch --]
[-- Type: text/x-diff, Size: 2873 bytes --]
From 2c8678e5b40d2eaf46c46ea492fb4c7297afbf87 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 10 Aug 2022 22:43:15 +0200
Subject: [PATCH] tea: add shell completion scripts
---
srcpkgs/tea/patches/completion-fix.patch | 49 ++++++++++++++++++++++++
srcpkgs/tea/template | 10 ++++-
2 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/tea/patches/completion-fix.patch
diff --git a/srcpkgs/tea/patches/completion-fix.patch b/srcpkgs/tea/patches/completion-fix.patch
new file mode 100644
index 000000000000..ada625f27be1
--- /dev/null
+++ b/srcpkgs/tea/patches/completion-fix.patch
@@ -0,0 +1,49 @@
+diff --git a/cmd/autocomplete.go b/cmd/autocomplete.go
+index 4c0ab1a..7e9b0a4 100644
+--- a/cmd/autocomplete.go
++++ b/cmd/autocomplete.go
+@@ -122,6 +122,9 @@ func writeFishAutoCompleteFile(ctx *cli.Context) error {
+ return err
+ }
+
++ _, status := io.WriteString(os.Stdout, script)
++ return status
++
+ localPath, err := xdg.ConfigFile("fish/conf.d/tea_completion.fish")
+ if err != nil {
+ return err
+diff --git a/contrib/autocomplete.sh b/contrib/autocomplete.sh
+index f0f6241..17f7ce1 100644
+--- a/contrib/autocomplete.sh
++++ b/contrib/autocomplete.sh
+@@ -1,7 +1,5 @@
+ #! /bin/bash
+
+-: ${PROG:=$(basename ${BASH_SOURCE})}
+-
+ _cli_bash_autocomplete() {
+ if [[ "${COMP_WORDS[0]}" != "source" ]]; then
+ local cur opts base
+@@ -17,5 +15,4 @@ _cli_bash_autocomplete() {
+ fi
+ }
+
+-complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete $PROG
+-unset PROG
++complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete tea
+diff --git a/contrib/autocomplete.zsh b/contrib/autocomplete.zsh
+index cf39c88..f718c0a 100644
+--- a/contrib/autocomplete.zsh
++++ b/contrib/autocomplete.zsh
+@@ -1,4 +1,4 @@
+-#compdef $PROG
++#compdef tea
+
+ _cli_zsh_autocomplete() {
+
+@@ -20,4 +20,4 @@ _cli_zsh_autocomplete() {
+ return
+ }
+
+-compdef _cli_zsh_autocomplete $PROG
++compdef _cli_zsh_autocomplete tea
diff --git a/srcpkgs/tea/template b/srcpkgs/tea/template
index 5b01c790341f..ba864a5264b5 100644
--- a/srcpkgs/tea/template
+++ b/srcpkgs/tea/template
@@ -1,9 +1,10 @@
# Template file for 'tea'
pkgname=tea
version=0.8.0
-revision=1
+revision=2
wrksrc=$pkgname
build_style=go
+build_helper=qemu
go_import_path=code.gitea.io/tea
depends="git"
short_desc="Command line tool to interact with Gitea"
@@ -15,5 +16,12 @@ distfiles="https://gitea.com/gitea/tea/archive/v${version}.tar.gz"
checksum=6c73c0a7b66cdfd1e5a302257d54df06a3a41eb9bdbfeb547966db431ae23b23
post_install() {
+ vcompletion contrib/autocomplete.sh bash
+ vcompletion contrib/autocomplete.zsh zsh
+
+ binary=$(find $GOPATH/bin -name $pkgname)
+ vtargetrun ${binary} shellcompletion fish > tea.fish
+ vcompletion tea.fish fish
+
vlicense LICENSE
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PR PATCH] [Merged]: tea: add shell completion scripts
2022-08-10 20:44 [PR PATCH] tea: add shell completion scripts tranzystorek-io
@ 2022-08-11 6:53 ` classabbyamp
0 siblings, 0 replies; 2+ messages in thread
From: classabbyamp @ 2022-08-11 6:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]
There's a merged pull request on the void-packages repository
tea: add shell completion scripts
https://github.com/void-linux/void-packages/pull/38591
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-11 6:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 20:44 [PR PATCH] tea: add shell completion scripts tranzystorek-io
2022-08-11 6:53 ` [PR PATCH] [Merged]: " classabbyamp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).