aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lab/allow-completion.patch
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-07-25 17:15:53 -0300
committerLeo <thinkabit.ukim@gmail.com>2019-07-25 17:23:24 -0300
commit7d6cd3741d8132ab5568538bb5d48de92a4b81fc (patch)
tree60d723a594470142b4ad31d069355db496b8abd2 /testing/lab/allow-completion.patch
parent9e124e2caee5b902db787510b077485aa0139ccf (diff)
downloadaports-7d6cd3741d8132ab5568538bb5d48de92a4b81fc.tar.bz2
aports-7d6cd3741d8132ab5568538bb5d48de92a4b81fc.tar.xz
testing/lab: add upstream patches for shell completion and xdg compliance
Diffstat (limited to 'testing/lab/allow-completion.patch')
-rw-r--r--testing/lab/allow-completion.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/lab/allow-completion.patch b/testing/lab/allow-completion.patch
new file mode 100644
index 0000000000..cbfd6668ae
--- /dev/null
+++ b/testing/lab/allow-completion.patch
@@ -0,0 +1,38 @@
+From c5d445472c183f6437966b2b1e9e68dab5926c24 Mon Sep 17 00:00:00 2001
+From: Zaq? Wiedmann <zaquestion@gmail.com>
+Date: Thu, 25 Jul 2019 12:37:49 -0700
+Subject: [PATCH] #321: allow completions to be generated without
+ authenticating with GitLab
+
+This makes it easy for distributors to provide completion out of the box in packaged versions of lab
+---
+ main.go | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/main.go b/main.go
+index 9a836b9..ba3f21c 100644
+--- a/main.go
++++ b/main.go
+@@ -127,6 +127,20 @@ func getUser(host, token string) string {
+ func main() {
+ log.SetFlags(log.LstdFlags | log.Lshortfile)
+ cmd.Version = version
+- lab.Init(loadConfig())
++ if !skipInit() {
++ lab.Init(loadConfig())
++ }
+ cmd.Execute()
+ }
++
++func skipInit() bool {
++ if len(os.Args) <= 1 {
++ return false
++ }
++ switch os.Args[1] {
++ case "completion":
++ return true
++ default:
++ return false
++ }
++}
+