Github messages for voidlinux
 help / color / mirror / Atom feed
From: tranzystorek-io <tranzystorek-io@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] tea: add shell completion scripts
Date: Wed, 10 Aug 2022 22:44:49 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-38591@inbox.vuxu.org> (raw)

[-- 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
 }

             reply	other threads:[~2022-08-10 20:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 20:44 tranzystorek-io [this message]
2022-08-11  6:53 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-38591@inbox.vuxu.org \
    --to=tranzystorek-io@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).