Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package konstraint for openSUSE:Factory 
checked in at 2023-04-13 14:11:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/konstraint (Old)
 and      /work/SRC/openSUSE:Factory/.konstraint.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "konstraint"

Thu Apr 13 14:11:11 2023 rev:17 rq:1079068 version:0.27.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/konstraint/konstraint.changes    2023-04-03 
17:46:57.025874762 +0200
+++ /work/SRC/openSUSE:Factory/.konstraint.new.19717/konstraint.changes 
2023-04-13 14:11:14.528466969 +0200
@@ -1,0 +2,9 @@
+Thu Apr 13 07:23:29 UTC 2023 - ka...@b1-systems.de
+
+- Update to version 0.27.1:
+  * Bump github.com/spf13/cobra from 1.6.1 to 1.7.0 (#388)
+  * Bump golang from 1.20.2-alpine to 1.20.3-alpine (#392)
+  * Added build step for linux/arm64 to make release (#390)
+  * Bump alpine from 3.17.2 to 3.17.3 (#387)
+
+-------------------------------------------------------------------

Old:
----
  konstraint-0.27.0.obscpio

New:
----
  konstraint-0.27.1.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ konstraint.spec ++++++
--- /var/tmp/diff_new_pack.DkE16O/_old  2023-04-13 14:11:15.328471562 +0200
+++ /var/tmp/diff_new_pack.DkE16O/_new  2023-04-13 14:11:15.332471585 +0200
@@ -19,7 +19,7 @@
 %define __arch_install_post export NO_BRP_STRIP_DEBUG=true
 
 Name:           konstraint
-Version:        0.27.0
+Version:        0.27.1
 Release:        0
 Summary:        A policy management tool for interacting with Gatekeeper
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.DkE16O/_old  2023-04-13 14:11:15.364471769 +0200
+++ /var/tmp/diff_new_pack.DkE16O/_new  2023-04-13 14:11:15.368471792 +0200
@@ -3,7 +3,7 @@
     <param name="url">https://github.com/plexsystems/konstraint</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">v0.27.0</param>
+    <param name="revision">v0.27.1</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">enable</param>
     <param name="versionrewrite-pattern">v(.*)</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.DkE16O/_old  2023-04-13 14:11:15.388471907 +0200
+++ /var/tmp/diff_new_pack.DkE16O/_new  2023-04-13 14:11:15.392471930 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/plexsystems/konstraint</param>
-              <param 
name="changesrevision">a3539ed7019b23742caffe75691c4dc623967744</param></service></servicedata>
+              <param 
name="changesrevision">d5777be26e458046f108af0f793c7132ab576afa</param></service></servicedata>
 (No newline at EOF)
 

++++++ konstraint-0.27.0.obscpio -> konstraint-0.27.1.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/konstraint-0.27.0/Dockerfile 
new/konstraint-0.27.1/Dockerfile
--- old/konstraint-0.27.0/Dockerfile    2023-04-02 20:02:18.000000000 +0200
+++ new/konstraint-0.27.1/Dockerfile    2023-04-11 18:40:13.000000000 +0200
@@ -1,4 +1,4 @@
-FROM golang:1.20.2-alpine AS build
+FROM golang:1.20.3-alpine AS build
 ARG KONSTRAINT_VER
 
 WORKDIR /go/src/github.com/plexsystems/konstraint
@@ -12,6 +12,6 @@
 
 RUN go build -o /konstraint -ldflags="-X 
'github.com/plexsystems/konstraint/internal/commands.version=${KONSTRAINT_VER}'"
 
-FROM alpine:3.17.2
+FROM alpine:3.17.3
 COPY --from=build /konstraint /usr/bin/konstraint
 ENTRYPOINT ["konstraint"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/konstraint-0.27.0/Makefile 
new/konstraint-0.27.1/Makefile
--- old/konstraint-0.27.0/Makefile      2023-04-02 20:02:18.000000000 +0200
+++ new/konstraint-0.27.1/Makefile      2023-04-11 18:40:13.000000000 +0200
@@ -63,6 +63,7 @@
        GOOS=darwin GOARCH=arm64 go build -o build/konstraint-darwin-arm64 
-ldflags="-s -w -X 
'github.com/plexsystems/konstraint/internal/commands.version=$(version)'"
        GOOS=windows GOARCH=amd64 go build -o 
build/konstraint-windows-amd64.exe -ldflags="-s -w -X 
'github.com/plexsystems/konstraint/internal/commands.version=$(version)'"
        GOOS=linux GOARCH=amd64 go build -o build/konstraint-linux-amd64 
-ldflags="-s -w -X 
'github.com/plexsystems/konstraint/internal/commands.version=$(version)'"
+       GOOS=linux GOARCH=arm64 go build -o build/konstraint-linux-arm64 
-ldflags="-s -w -X 
'github.com/plexsystems/konstraint/internal/commands.version=$(version)'"
        docker run --user $(shell id -u):$(shell id -g) --rm -v $(shell 
pwd):/konstraint alpine:3 /bin/ash -c 'cd /konstraint/build && sha256sum 
konstraint-* > checksums.txt'
 
 help:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/konstraint-0.27.0/go.mod new/konstraint-0.27.1/go.mod
--- old/konstraint-0.27.0/go.mod        2023-04-02 20:02:18.000000000 +0200
+++ new/konstraint-0.27.1/go.mod        2023-04-11 18:40:13.000000000 +0200
@@ -7,7 +7,7 @@
        github.com/open-policy-agent/frameworks/constraint 
v0.0.0-20220218180203-c2a0d8cdf85a
        github.com/open-policy-agent/opa v0.51.0
        github.com/sirupsen/logrus v1.9.0
-       github.com/spf13/cobra v1.6.1
+       github.com/spf13/cobra v1.7.0
        github.com/spf13/viper v1.15.0
        golang.org/x/text v0.8.0
        k8s.io/apiextensions-apiserver v0.26.3
@@ -34,7 +34,7 @@
        github.com/google/gofuzz v1.2.0 // indirect
        github.com/google/uuid v1.3.0 // indirect
        github.com/hashicorp/hcl v1.0.0 // indirect
-       github.com/inconshreveable/mousetrap v1.0.1 // indirect
+       github.com/inconshreveable/mousetrap v1.1.0 // indirect
        github.com/josharian/intern v1.0.0 // indirect
        github.com/json-iterator/go v1.1.12 // indirect
        github.com/magiconair/properties v1.8.7 // indirect
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/konstraint-0.27.0/go.sum new/konstraint-0.27.1/go.sum
--- old/konstraint-0.27.0/go.sum        2023-04-02 20:02:18.000000000 +0200
+++ new/konstraint-0.27.1/go.sum        2023-04-11 18:40:13.000000000 +0200
@@ -197,8 +197,8 @@
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod 
h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod 
h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/imdario/mergo v0.3.12 
h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
-github.com/inconshreveable/mousetrap v1.0.1 
h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
-github.com/inconshreveable/mousetrap v1.0.1/go.mod 
h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
+github.com/inconshreveable/mousetrap v1.1.0 
h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
+github.com/inconshreveable/mousetrap v1.1.0/go.mod 
h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
 github.com/josharian/intern v1.0.0 
h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
 github.com/josharian/intern v1.0.0/go.mod 
h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
 github.com/jpillora/backoff v1.0.0/go.mod 
h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
@@ -304,8 +304,8 @@
 github.com/spf13/afero v1.9.3/go.mod 
h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
 github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
 github.com/spf13/cast v1.5.0/go.mod 
h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
-github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
-github.com/spf13/cobra v1.6.1/go.mod 
h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
+github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
+github.com/spf13/cobra v1.7.0/go.mod 
h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
 github.com/spf13/jwalterweatherman v1.1.0 
h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
 github.com/spf13/jwalterweatherman v1.1.0/go.mod 
h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
 github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

++++++ konstraint.obsinfo ++++++
--- /var/tmp/diff_new_pack.DkE16O/_old  2023-04-13 14:11:15.544472802 +0200
+++ /var/tmp/diff_new_pack.DkE16O/_new  2023-04-13 14:11:15.544472802 +0200
@@ -1,5 +1,5 @@
 name: konstraint
-version: 0.27.0
-mtime: 1680458538
-commit: a3539ed7019b23742caffe75691c4dc623967744
+version: 0.27.1
+mtime: 1681231213
+commit: d5777be26e458046f108af0f793c7132ab576afa
 

++++++ vendor.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vendor/github.com/inconshreveable/mousetrap/trap_others.go 
new/vendor/github.com/inconshreveable/mousetrap/trap_others.go
--- old/vendor/github.com/inconshreveable/mousetrap/trap_others.go      
2023-04-03 14:03:36.000000000 +0200
+++ new/vendor/github.com/inconshreveable/mousetrap/trap_others.go      
2023-04-13 09:23:31.000000000 +0200
@@ -1,3 +1,4 @@
+//go:build !windows
 // +build !windows
 
 package mousetrap
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vendor/github.com/inconshreveable/mousetrap/trap_windows.go 
new/vendor/github.com/inconshreveable/mousetrap/trap_windows.go
--- old/vendor/github.com/inconshreveable/mousetrap/trap_windows.go     
2023-04-03 14:03:36.000000000 +0200
+++ new/vendor/github.com/inconshreveable/mousetrap/trap_windows.go     
2023-04-13 09:23:31.000000000 +0200
@@ -1,81 +1,32 @@
-// +build windows
-// +build !go1.4
-
 package mousetrap
 
 import (
-       "fmt"
-       "os"
        "syscall"
        "unsafe"
 )
 
-const (
-       // defined by the Win32 API
-       th32cs_snapprocess uintptr = 0x2
-)
-
-var (
-       kernel                   = syscall.MustLoadDLL("kernel32.dll")
-       CreateToolhelp32Snapshot = 
kernel.MustFindProc("CreateToolhelp32Snapshot")
-       Process32First           = kernel.MustFindProc("Process32FirstW")
-       Process32Next            = kernel.MustFindProc("Process32NextW")
-)
-
-// ProcessEntry32 structure defined by the Win32 API
-type processEntry32 struct {
-       dwSize              uint32
-       cntUsage            uint32
-       th32ProcessID       uint32
-       th32DefaultHeapID   int
-       th32ModuleID        uint32
-       cntThreads          uint32
-       th32ParentProcessID uint32
-       pcPriClassBase      int32
-       dwFlags             uint32
-       szExeFile           [syscall.MAX_PATH]uint16
-}
-
-func getProcessEntry(pid int) (pe *processEntry32, err error) {
-       snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, 
uintptr(0))
-       if snapshot == uintptr(syscall.InvalidHandle) {
-               err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1)
-               return
+func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
+       snapshot, err := 
syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)
+       if err != nil {
+               return nil, err
        }
-       defer syscall.CloseHandle(syscall.Handle(snapshot))
-
-       var processEntry processEntry32
-       processEntry.dwSize = uint32(unsafe.Sizeof(processEntry))
-       ok, _, e1 := Process32First.Call(snapshot, 
uintptr(unsafe.Pointer(&processEntry)))
-       if ok == 0 {
-               err = fmt.Errorf("Process32First: %v", e1)
-               return
+       defer syscall.CloseHandle(snapshot)
+       var procEntry syscall.ProcessEntry32
+       procEntry.Size = uint32(unsafe.Sizeof(procEntry))
+       if err = syscall.Process32First(snapshot, &procEntry); err != nil {
+               return nil, err
        }
-
        for {
-               if processEntry.th32ProcessID == uint32(pid) {
-                       pe = &processEntry
-                       return
+               if procEntry.ProcessID == uint32(pid) {
+                       return &procEntry, nil
                }
-
-               ok, _, e1 = Process32Next.Call(snapshot, 
uintptr(unsafe.Pointer(&processEntry)))
-               if ok == 0 {
-                       err = fmt.Errorf("Process32Next: %v", e1)
-                       return
+               err = syscall.Process32Next(snapshot, &procEntry)
+               if err != nil {
+                       return nil, err
                }
        }
 }
 
-func getppid() (pid int, err error) {
-       pe, err := getProcessEntry(os.Getpid())
-       if err != nil {
-               return
-       }
-
-       pid = int(pe.th32ParentProcessID)
-       return
-}
-
 // StartedByExplorer returns true if the program was invoked by the user 
double-clicking
 // on the executable from explorer.exe
 //
@@ -83,16 +34,9 @@
 // It does not guarantee that the program was run from a terminal. It only can 
tell you
 // whether it was launched from explorer.exe
 func StartedByExplorer() bool {
-       ppid, err := getppid()
+       pe, err := getProcessEntry(syscall.Getppid())
        if err != nil {
                return false
        }
-
-       pe, err := getProcessEntry(ppid)
-       if err != nil {
-               return false
-       }
-
-       name := syscall.UTF16ToString(pe.szExeFile[:])
-       return name == "explorer.exe"
+       return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:])
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go 
new/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
--- old/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go 
2023-04-03 14:03:36.000000000 +0200
+++ new/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go 
1970-01-01 01:00:00.000000000 +0100
@@ -1,46 +0,0 @@
-// +build windows
-// +build go1.4
-
-package mousetrap
-
-import (
-       "os"
-       "syscall"
-       "unsafe"
-)
-
-func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
-       snapshot, err := 
syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)
-       if err != nil {
-               return nil, err
-       }
-       defer syscall.CloseHandle(snapshot)
-       var procEntry syscall.ProcessEntry32
-       procEntry.Size = uint32(unsafe.Sizeof(procEntry))
-       if err = syscall.Process32First(snapshot, &procEntry); err != nil {
-               return nil, err
-       }
-       for {
-               if procEntry.ProcessID == uint32(pid) {
-                       return &procEntry, nil
-               }
-               err = syscall.Process32Next(snapshot, &procEntry)
-               if err != nil {
-                       return nil, err
-               }
-       }
-}
-
-// StartedByExplorer returns true if the program was invoked by the user 
double-clicking
-// on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can 
tell you
-// whether it was launched from explorer.exe
-func StartedByExplorer() bool {
-       pe, err := getProcessEntry(os.Getppid())
-       if err != nil {
-               return false
-       }
-       return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:])
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/.golangci.yml 
new/vendor/github.com/spf13/cobra/.golangci.yml
--- old/vendor/github.com/spf13/cobra/.golangci.yml     2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/.golangci.yml     2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-# Copyright 2013-2022 The Cobra Authors
+# Copyright 2013-2023 The Cobra Authors
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/Makefile 
new/vendor/github.com/spf13/cobra/Makefile
--- old/vendor/github.com/spf13/cobra/Makefile  2023-04-03 14:03:36.000000000 
+0200
+++ new/vendor/github.com/spf13/cobra/Makefile  2023-04-13 09:23:31.000000000 
+0200
@@ -5,10 +5,6 @@
 $(warning "could not find golangci-lint in $(PATH), run: curl -sfL 
https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh")
 endif
 
-ifeq (, $(shell which richgo))
-$(warning "could not find richgo in $(PATH), run: go install 
github.com/kyoh86/richgo@latest")
-endif
-
 .PHONY: fmt lint test install_deps clean
 
 default: all
@@ -25,6 +21,10 @@
 
 test: install_deps
        $(info ******************** running tests ********************)
+       go test -v ./...
+
+richtest: install_deps
+       $(info ******************** running tests with kyoh86/richgo 
********************)
        richgo test -v ./...
 
 install_deps:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/README.md 
new/vendor/github.com/spf13/cobra/README.md
--- old/vendor/github.com/spf13/cobra/README.md 2023-04-03 14:03:36.000000000 
+0200
+++ new/vendor/github.com/spf13/cobra/README.md 2023-04-13 09:23:31.000000000 
+0200
@@ -1,4 +1,4 @@
-![cobra 
logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)
+![cobra logo](assets/CobraMain.png)
 
 Cobra is a library for creating powerful modern CLI applications.
 
@@ -6,7 +6,7 @@
 [Hugo](https://gohugo.io), and [GitHub CLI](https://github.com/cli/cli) to
 name a few. [This list](./projects_using_cobra.md) contains a more extensive 
list of projects using Cobra.
 
-[![](https://img.shields.io/github/workflow/status/spf13/cobra/Test?longCache=tru&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest)
+[![](https://img.shields.io/github/actions/workflow/status/spf13/cobra/test.yml?branch=main&longCache=true&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest)
 [![Go 
Reference](https://pkg.go.dev/badge/github.com/spf13/cobra.svg)](https://pkg.go.dev/github.com/spf13/cobra)
 [![Go Report 
Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra)
 
[![Slack](https://img.shields.io/badge/Slack-cobra-brightgreen)](https://gophers.slack.com/archives/CD3LP1199)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/active_help.go 
new/vendor/github.com/spf13/cobra/active_help.go
--- old/vendor/github.com/spf13/cobra/active_help.go    2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/active_help.go    2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/args.go 
new/vendor/github.com/spf13/cobra/args.go
--- old/vendor/github.com/spf13/cobra/args.go   2023-04-03 14:03:36.000000000 
+0200
+++ new/vendor/github.com/spf13/cobra/args.go   2023-04-13 09:23:31.000000000 
+0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 
 type PositionalArgs func(cmd *Command, args []string) error
 
-// Legacy arg validation has the following behaviour:
+// legacyArgs validation has the following behaviour:
 // - root commands with no subcommands can take arbitrary arguments
 // - root commands with subcommands will do subcommand validity checking
 // - subcommands will always accept arbitrary arguments
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/bash_completions.go 
new/vendor/github.com/spf13/cobra/bash_completions.go
--- old/vendor/github.com/spf13/cobra/bash_completions.go       2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/bash_completions.go       2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -532,7 +532,7 @@
        }
 }
 
-// Setup annotations for go completions for registered flags
+// prepareCustomAnnotationsForFlags setup annotations for go completions for 
registered flags
 func prepareCustomAnnotationsForFlags(cmd *Command) {
        flagCompletionMutex.RLock()
        defer flagCompletionMutex.RUnlock()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/bash_completionsV2.go 
new/vendor/github.com/spf13/cobra/bash_completionsV2.go
--- old/vendor/github.com/spf13/cobra/bash_completionsV2.go     2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/bash_completionsV2.go     2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
 
 __%[1]s_debug()
 {
-    if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then
+    if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
         echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
     fi
 }
@@ -65,7 +65,7 @@
     lastChar=${lastParam:$((${#lastParam}-1)):1}
     __%[1]s_debug "lastParam ${lastParam}, lastChar ${lastChar}"
 
-    if [ -z "${cur}" ] && [ "${lastChar}" != "=" ]; then
+    if [[ -z ${cur} && ${lastChar} != = ]]; then
         # If the last parameter is complete (there is a space following it)
         # We add an extra empty parameter so we can indicate this to the go 
method.
         __%[1]s_debug "Adding extra empty parameter"
@@ -75,7 +75,7 @@
     # When completing a flag with an = (e.g., %[1]s -n=<TAB>)
     # bash focuses on the part after the =, so we need to remove
     # the flag part from $cur
-    if [[ "${cur}" == -*=* ]]; then
+    if [[ ${cur} == -*=* ]]; then
         cur="${cur#*=}"
     fi
 
@@ -87,7 +87,7 @@
     directive=${out##*:}
     # Remove the directive
     out=${out%%:*}
-    if [ "${directive}" = "${out}" ]; then
+    if [[ ${directive} == "${out}" ]]; then
         # There is not directive specified
         directive=0
     fi
@@ -101,22 +101,36 @@
     local shellCompDirectiveNoFileComp=%[5]d
     local shellCompDirectiveFilterFileExt=%[6]d
     local shellCompDirectiveFilterDirs=%[7]d
+    local shellCompDirectiveKeepOrder=%[8]d
 
-    if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
+    if (((directive & shellCompDirectiveError) != 0)); then
         # Error code.  No completion.
         __%[1]s_debug "Received error from custom completion go code"
         return
     else
-        if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
-            if [[ $(type -t compopt) = "builtin" ]]; then
+        if (((directive & shellCompDirectiveNoSpace) != 0)); then
+            if [[ $(type -t compopt) == builtin ]]; then
                 __%[1]s_debug "Activating no space"
                 compopt -o nospace
             else
                 __%[1]s_debug "No space directive not supported in this 
version of bash"
             fi
         fi
-        if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
-            if [[ $(type -t compopt) = "builtin" ]]; then
+        if (((directive & shellCompDirectiveKeepOrder) != 0)); then
+            if [[ $(type -t compopt) == builtin ]]; then
+                # no sort isn't supported for bash less than < 4.4
+                if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 
&& ${BASH_VERSINFO[1]} -lt 4 ) ]]; then
+                    __%[1]s_debug "No sort directive not supported in this 
version of bash"
+                else
+                    __%[1]s_debug "Activating keep order"
+                    compopt -o nosort
+                fi
+            else
+                __%[1]s_debug "No sort directive not supported in this version 
of bash"
+            fi
+        fi
+        if (((directive & shellCompDirectiveNoFileComp) != 0)); then
+            if [[ $(type -t compopt) == builtin ]]; then
                 __%[1]s_debug "Activating no file completion"
                 compopt +o default
             else
@@ -130,7 +144,7 @@
     local activeHelp=()
     __%[1]s_extract_activeHelp
 
-    if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
+    if (((directive & shellCompDirectiveFilterFileExt) != 0)); then
         # File extension filtering
         local fullFilter filter filteringCmd
 
@@ -143,13 +157,12 @@
         filteringCmd="_filedir $fullFilter"
         __%[1]s_debug "File filtering command: $filteringCmd"
         $filteringCmd
-    elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
+    elif (((directive & shellCompDirectiveFilterDirs) != 0)); then
         # File completion for directories only
 
-        # Use printf to strip any trailing newline
         local subdir
-        subdir=$(printf "%%s" "${completions[0]}")
-        if [ -n "$subdir" ]; then
+        subdir=${completions[0]}
+        if [[ -n $subdir ]]; then
             __%[1]s_debug "Listing directories in $subdir"
             pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 
2>&1 || return
         else
@@ -164,7 +177,7 @@
     __%[1]s_handle_special_char "$cur" =
 
     # Print the activeHelp statements before we finish
-    if [ ${#activeHelp[*]} -ne 0 ]; then
+    if ((${#activeHelp[*]} != 0)); then
         printf "\n";
         printf "%%s\n" "${activeHelp[@]}"
         printf "\n"
@@ -184,21 +197,21 @@
 # Separate activeHelp lines from real completions.
 # Fills the $activeHelp and $completions arrays.
 __%[1]s_extract_activeHelp() {
-    local activeHelpMarker="%[8]s"
+    local activeHelpMarker="%[9]s"
     local endIndex=${#activeHelpMarker}
 
     while IFS='' read -r comp; do
-        if [ "${comp:0:endIndex}" = "$activeHelpMarker" ]; then
+        if [[ ${comp:0:endIndex} == $activeHelpMarker ]]; then
             comp=${comp:endIndex}
             __%[1]s_debug "ActiveHelp found: $comp"
-            if [ -n "$comp" ]; then
+            if [[ -n $comp ]]; then
                 activeHelp+=("$comp")
             fi
         else
             # Not an activeHelp line but a normal completion
             completions+=("$comp")
         fi
-    done < <(printf "%%s\n" "${out}")
+    done <<<"${out}"
 }
 
 __%[1]s_handle_completion_types() {
@@ -254,7 +267,7 @@
     done < <(printf "%%s\n" "${completions[@]}")
 
     # If there is a single completion left, remove the description text
-    if [ ${#COMPREPLY[*]} -eq 1 ]; then
+    if ((${#COMPREPLY[*]} == 1)); then
         __%[1]s_debug "COMPREPLY[0]: ${COMPREPLY[0]}"
         comp="${COMPREPLY[0]%%%%$tab*}"
         __%[1]s_debug "Removed description from single completion, which is 
now: ${comp}"
@@ -271,8 +284,8 @@
     if [[ "$comp" == *${char}* && "$COMP_WORDBREAKS" == *${char}* ]]; then
         local word=${comp%%"${comp##*${char}}"}
         local idx=${#COMPREPLY[*]}
-        while [[ $((--idx)) -ge 0 ]]; do
-            COMPREPLY[$idx]=${COMPREPLY[$idx]#"$word"}
+        while ((--idx >= 0)); do
+            COMPREPLY[idx]=${COMPREPLY[idx]#"$word"}
         done
     fi
 }
@@ -298,7 +311,7 @@
 
             # Make sure we can fit a description of at least 8 characters
             # if we are to align the descriptions.
-            if [[ $maxdesclength -gt 8 ]]; then
+            if ((maxdesclength > 8)); then
                 # Add the proper number of spaces to align the descriptions
                 for ((i = ${#comp} ; i < longest ; i++)); do
                     comp+=" "
@@ -310,8 +323,8 @@
 
             # If there is enough space for any description text,
             # truncate the descriptions that are too long for the shell width
-            if [ $maxdesclength -gt 0 ]; then
-                if [ ${#desc} -gt $maxdesclength ]; then
+            if ((maxdesclength > 0)); then
+                if ((${#desc} > maxdesclength)); then
                     desc=${desc:0:$(( maxdesclength - 1 ))}
                     desc+="…"
                 fi
@@ -332,9 +345,9 @@
     # Call _init_completion from the bash-completion package
     # to prepare the arguments properly
     if declare -F _init_completion >/dev/null 2>&1; then
-        _init_completion -n "=:" || return
+        _init_completion -n =: || return
     else
-        __%[1]s_init_completion -n "=:" || return
+        __%[1]s_init_completion -n =: || return
     fi
 
     __%[1]s_debug
@@ -361,7 +374,7 @@
 # ex: ts=4 sw=4 et filetype=sh
 `, name, compCmd,
                ShellCompDirectiveError, ShellCompDirectiveNoSpace, 
ShellCompDirectiveNoFileComp,
-               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs,
+               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, 
ShellCompDirectiveKeepOrder,
                activeHelpMarker))
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/cobra.go 
new/vendor/github.com/spf13/cobra/cobra.go
--- old/vendor/github.com/spf13/cobra/cobra.go  2023-04-03 14:03:36.000000000 
+0200
+++ new/vendor/github.com/spf13/cobra/cobra.go  2023-04-13 09:23:31.000000000 
+0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -167,8 +167,8 @@
 
 // rpad adds padding to the right of a string.
 func rpad(s string, padding int) string {
-       template := fmt.Sprintf("%%-%ds", padding)
-       return fmt.Sprintf(template, s)
+       formattedString := fmt.Sprintf("%%-%ds", padding)
+       return fmt.Sprintf(formattedString, s)
 }
 
 // tmpl executes the given template text on data, writing the result to w.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/command.go 
new/vendor/github.com/spf13/cobra/command.go
--- old/vendor/github.com/spf13/cobra/command.go        2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/command.go        2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@
 // FParseErrWhitelist configures Flag parse errors to be ignored
 type FParseErrWhitelist flag.ParseErrorsWhitelist
 
-// Structure to manage groups for commands
+// Group Structure to manage groups for commands
 type Group struct {
        ID    string
        Title string
@@ -47,7 +47,7 @@
 // definition to ensure usability.
 type Command struct {
        // Use is the one-line usage message.
-       // Recommended syntax is as follow:
+       // Recommended syntax is as follows:
        //   [ ] identifies an optional argument. Arguments that are not 
enclosed in brackets are required.
        //   ... indicates that you can specify multiple values for the 
previous argument.
        //   |   indicates mutually exclusive information. You can use the 
argument to the left of the separator or the
@@ -321,7 +321,7 @@
        c.helpCommand = cmd
 }
 
-// SetHelpCommandGroup sets the group id of the help command.
+// SetHelpCommandGroupID sets the group id of the help command.
 func (c *Command) SetHelpCommandGroupID(groupID string) {
        if c.helpCommand != nil {
                c.helpCommand.GroupID = groupID
@@ -330,7 +330,7 @@
        c.helpCommandGroupID = groupID
 }
 
-// SetCompletionCommandGroup sets the group id of the completion command.
+// SetCompletionCommandGroupID sets the group id of the completion command.
 func (c *Command) SetCompletionCommandGroupID(groupID string) {
        // completionCommandGroupID is used if no completion command is defined 
by the user
        c.Root().completionCommandGroupID = groupID
@@ -655,20 +655,44 @@
 
 // argsMinusFirstX removes only the first x from args.  Otherwise, commands 
that look like
 // openshift admin policy add-role-to-user admin my-user, lose the admin 
argument (arg[4]).
-func argsMinusFirstX(args []string, x string) []string {
-       for i, y := range args {
-               if x == y {
-                       ret := []string{}
-                       ret = append(ret, args[:i]...)
-                       ret = append(ret, args[i+1:]...)
-                       return ret
+// Special care needs to be taken not to remove a flag value.
+func (c *Command) argsMinusFirstX(args []string, x string) []string {
+       if len(args) == 0 {
+               return args
+       }
+       c.mergePersistentFlags()
+       flags := c.Flags()
+
+Loop:
+       for pos := 0; pos < len(args); pos++ {
+               s := args[pos]
+               switch {
+               case s == "--":
+                       // -- means we have reached the end of the parseable 
args. Break out of the loop now.
+                       break Loop
+               case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && 
!hasNoOptDefVal(s[2:], flags):
+                       fallthrough
+               case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && 
len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags):
+                       // This is a flag without a default value, and an equal 
sign is not used. Increment pos in order to skip
+                       // over the next arg, because that is the value of this 
flag.
+                       pos++
+                       continue
+               case !strings.HasPrefix(s, "-"):
+                       // This is not a flag or a flag value. Check to see if 
it matches what we're looking for, and if so,
+                       // return the args, excluding the one at this position.
+                       if s == x {
+                               ret := []string{}
+                               ret = append(ret, args[:pos]...)
+                               ret = append(ret, args[pos+1:]...)
+                               return ret
+                       }
                }
        }
        return args
 }
 
 func isFlagArg(arg string) bool {
-       return ((len(arg) >= 3 && arg[1] == '-') ||
+       return ((len(arg) >= 3 && arg[0:2] == "--") ||
                (len(arg) >= 2 && arg[0] == '-' && arg[1] != '-'))
 }
 
@@ -686,7 +710,7 @@
 
                cmd := c.findNext(nextSubCmd)
                if cmd != nil {
-                       return innerfind(cmd, argsMinusFirstX(innerArgs, 
nextSubCmd))
+                       return innerfind(cmd, c.argsMinusFirstX(innerArgs, 
nextSubCmd))
                }
                return c, innerArgs
        }
@@ -1272,7 +1296,7 @@
        return true
 }
 
-// ContainGroups return if groupID exists in the list of command groups.
+// ContainsGroup return if groupID exists in the list of command groups.
 func (c *Command) ContainsGroup(groupID string) bool {
        for _, x := range c.commandgroups {
                if x.ID == groupID {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/command_notwin.go 
new/vendor/github.com/spf13/cobra/command_notwin.go
--- old/vendor/github.com/spf13/cobra/command_notwin.go 2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/command_notwin.go 2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/command_win.go 
new/vendor/github.com/spf13/cobra/command_win.go
--- old/vendor/github.com/spf13/cobra/command_win.go    2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/command_win.go    2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/completions.go 
new/vendor/github.com/spf13/cobra/completions.go
--- old/vendor/github.com/spf13/cobra/completions.go    2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/completions.go    2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -77,6 +77,10 @@
        // obtain the same behavior but only for flags.
        ShellCompDirectiveFilterDirs
 
+       // ShellCompDirectiveKeepOrder indicates that the shell should preserve 
the order
+       // in which the completions are provided
+       ShellCompDirectiveKeepOrder
+
        // 
===========================================================================
 
        // All directives using iota should be above this one.
@@ -159,6 +163,9 @@
        if d&ShellCompDirectiveFilterDirs != 0 {
                directives = append(directives, "ShellCompDirectiveFilterDirs")
        }
+       if d&ShellCompDirectiveKeepOrder != 0 {
+               directives = append(directives, "ShellCompDirectiveKeepOrder")
+       }
        if len(directives) == 0 {
                directives = append(directives, "ShellCompDirectiveDefault")
        }
@@ -169,7 +176,7 @@
        return strings.Join(directives, ", ")
 }
 
-// Adds a special hidden command that can be used to request custom 
completions.
+// initCompleteCmd adds a special hidden command that can be used to request 
custom completions.
 func (c *Command) initCompleteCmd(args []string) {
        completeCmd := &Command{
                Use:                   fmt.Sprintf("%s [command-line]", 
ShellCompRequestCmd),
@@ -727,7 +734,7 @@
 
 To load completions in your current shell session:
 
-       source <(%[1]s completion zsh); compdef _%[1]s %[1]s
+       source <(%[1]s completion zsh)
 
 To load completions for every new session, execute once:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/fish_completions.go 
new/vendor/github.com/spf13/cobra/fish_completions.go
--- old/vendor/github.com/spf13/cobra/fish_completions.go       2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/fish_completions.go       2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@
     __%[1]s_debug "last arg: $lastArg"
 
     # Disable ActiveHelp which is not supported for fish shell
-    set -l requestComp "%[9]s=0 $args[1] %[3]s $args[2..-1] $lastArg"
+    set -l requestComp "%[10]s=0 $args[1] %[3]s $args[2..-1] $lastArg"
 
     __%[1]s_debug "Calling $requestComp"
     set -l results (eval $requestComp 2> /dev/null)
@@ -89,6 +89,60 @@
     printf "%%s\n" "$directiveLine"
 end
 
+# this function limits calls to __%[1]s_perform_completion, by caching the 
result behind $__%[1]s_perform_completion_once_result
+function __%[1]s_perform_completion_once
+    __%[1]s_debug "Starting __%[1]s_perform_completion_once"
+
+    if test -n "$__%[1]s_perform_completion_once_result"
+        __%[1]s_debug "Seems like a valid result already exists, skipping 
__%[1]s_perform_completion"
+        return 0
+    end
+
+    set --global __%[1]s_perform_completion_once_result 
(__%[1]s_perform_completion)
+    if test -z "$__%[1]s_perform_completion_once_result"
+        __%[1]s_debug "No completions, probably due to a failure"
+        return 1
+    end
+
+    __%[1]s_debug "Performed completions and set 
__%[1]s_perform_completion_once_result"
+    return 0
+end
+
+# this function is used to clear the $__%[1]s_perform_completion_once_result 
variable after completions are run
+function __%[1]s_clear_perform_completion_once_result
+    __%[1]s_debug ""
+    __%[1]s_debug "========= clearing previously set 
__%[1]s_perform_completion_once_result variable =========="
+    set --erase __%[1]s_perform_completion_once_result
+    __%[1]s_debug "Succesfully erased the variable 
__%[1]s_perform_completion_once_result"
+end
+
+function __%[1]s_requires_order_preservation
+    __%[1]s_debug ""
+    __%[1]s_debug "========= checking if order preservation is required 
=========="
+
+    __%[1]s_perform_completion_once
+    if test -z "$__%[1]s_perform_completion_once_result"
+        __%[1]s_debug "Error determining if order preservation is required"
+        return 1
+    end
+
+    set -l directive (string sub --start 2 
$__%[1]s_perform_completion_once_result[-1])
+    __%[1]s_debug "Directive is: $directive"
+
+    set -l shellCompDirectiveKeepOrder %[9]d
+    set -l keeporder (math (math --scale 0 $directive / 
$shellCompDirectiveKeepOrder) %% 2)
+    __%[1]s_debug "Keeporder is: $keeporder"
+
+    if test $keeporder -ne 0
+        __%[1]s_debug "This does require order preservation"
+        return 0
+    end
+
+    __%[1]s_debug "This doesn't require order preservation"
+    return 1
+end
+
+
 # This function does two things:
 # - Obtain the completions and store them in the global __%[1]s_comp_results
 # - Return false if file completion should be performed
@@ -99,17 +153,17 @@
     # Start fresh
     set --erase __%[1]s_comp_results
 
-    set -l results (__%[1]s_perform_completion)
-    __%[1]s_debug "Completion results: $results"
+    __%[1]s_perform_completion_once
+    __%[1]s_debug "Completion results: $__%[1]s_perform_completion_once_result"
 
-    if test -z "$results"
+    if test -z "$__%[1]s_perform_completion_once_result"
         __%[1]s_debug "No completion, probably due to a failure"
         # Might as well do file completion, in case it helps
         return 1
     end
 
-    set -l directive (string sub --start 2 $results[-1])
-    set --global __%[1]s_comp_results $results[1..-2]
+    set -l directive (string sub --start 2 
$__%[1]s_perform_completion_once_result[-1])
+    set --global __%[1]s_comp_results 
$__%[1]s_perform_completion_once_result[1..-2]
 
     __%[1]s_debug "Completions are: $__%[1]s_comp_results"
     __%[1]s_debug "Directive is: $directive"
@@ -205,13 +259,17 @@
 # Remove any pre-existing completions for the program since we will be 
handling all of them.
 complete -c %[2]s -e
 
+# this will get called after the two calls below and clear the 
$__%[1]s_perform_completion_once_result global
+complete -c %[2]s -n '__%[1]s_clear_perform_completion_once_result'
 # The call to __%[1]s_prepare_completions will setup __%[1]s_comp_results
 # which provides the program's completion choices.
-complete -c %[2]s -n '__%[1]s_prepare_completions' -f -a 
'$__%[1]s_comp_results'
-
+# If this doesn't require order preservation, we don't use the -k flag
+complete -c %[2]s -n 'not __%[1]s_requires_order_preservation && 
__%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results'
+# otherwise we use the -k flag
+complete -k -c %[2]s -n '__%[1]s_requires_order_preservation && 
__%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results'
 `, nameForVar, name, compCmd,
                ShellCompDirectiveError, ShellCompDirectiveNoSpace, 
ShellCompDirectiveNoFileComp,
-               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, 
activeHelpEnvVar(name)))
+               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, 
ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))
 }
 
 // GenFishCompletion generates fish completion file and writes to the passed 
writer.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/flag_groups.go 
new/vendor/github.com/spf13/cobra/flag_groups.go
--- old/vendor/github.com/spf13/cobra/flag_groups.go    2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/flag_groups.go    2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vendor/github.com/spf13/cobra/powershell_completions.go 
new/vendor/github.com/spf13/cobra/powershell_completions.go
--- old/vendor/github.com/spf13/cobra/powershell_completions.go 2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/powershell_completions.go 2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -77,6 +77,7 @@
     $ShellCompDirectiveNoFileComp=%[6]d
     $ShellCompDirectiveFilterFileExt=%[7]d
     $ShellCompDirectiveFilterDirs=%[8]d
+    $ShellCompDirectiveKeepOrder=%[9]d
 
     # Prepare the command to request completions for the program.
     # Split the command at the first space to separate the program and 
arguments.
@@ -106,13 +107,22 @@
         # If the last parameter is complete (there is a space following it)
         # We add an extra empty parameter so we can indicate this to the go 
method.
         __%[1]s_debug "Adding extra empty parameter"
-`+"        # We need to use `\"`\" to pass an empty argument a \"\" or '' does 
not work!!!"+`
-`+"        $RequestComp=\"$RequestComp\" + ' `\"`\"'"+`
+        # PowerShell 7.2+ changed the way how the arguments are passed to 
executables,
+        # so for pre-7.2 or when Legacy argument passing is enabled we need to 
use
+`+"        # `\"`\" to pass an empty argument, a \"\" or '' does not work!!!"+`
+        if ($PSVersionTable.PsVersion -lt [version]'7.2.0' -or
+            ($PSVersionTable.PsVersion -lt [version]'7.3.0' -and -not 
[ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -or
+            (($PSVersionTable.PsVersion -ge [version]'7.3.0' -or 
[ExperimentalFeature]::IsEnabled("PSNativeCommandArgumentPassing")) -and
+              $PSNativeCommandArgumentPassing -eq 'Legacy')) {
+`+"             $RequestComp=\"$RequestComp\" + ' `\"`\"'"+`
+        } else {
+             $RequestComp="$RequestComp" + ' ""'
+        }
     }
 
     __%[1]s_debug "Calling $RequestComp"
     # First disable ActiveHelp which is not supported for Powershell
-    $env:%[9]s=0
+    $env:%[10]s=0
 
     #call the command store the output in $out and redirect stderr and stdout 
to null
     # $Out is an array contains each line per element
@@ -137,7 +147,7 @@
     }
 
     $Longest = 0
-    $Values = $Out | ForEach-Object {
+    [Array]$Values = $Out | ForEach-Object {
         #Split the output in name and description
 `+"        $Name, $Description = $_.Split(\"`t\",2)"+`
         __%[1]s_debug "Name: $Name Description: $Description"
@@ -182,6 +192,11 @@
         }
     }
 
+    # we sort the values in ascending order by name if keep order isn't passed
+    if (($Directive -band $ShellCompDirectiveKeepOrder) -eq 0 ) {
+        $Values = $Values | Sort-Object -Property Name
+    }
+
     if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {
         __%[1]s_debug "ShellCompDirectiveNoFileComp is called"
 
@@ -267,7 +282,7 @@
 Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock 
$__%[2]sCompleterBlock
 `, name, nameForVar, compCmd,
                ShellCompDirectiveError, ShellCompDirectiveNoSpace, 
ShellCompDirectiveNoFileComp,
-               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, 
activeHelpEnvVar(name)))
+               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, 
ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))
 }
 
 func (c *Command) genPowerShellCompletion(w io.Writer, includeDesc bool) error 
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vendor/github.com/spf13/cobra/projects_using_cobra.md 
new/vendor/github.com/spf13/cobra/projects_using_cobra.md
--- old/vendor/github.com/spf13/cobra/projects_using_cobra.md   2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/projects_using_cobra.md   2023-04-13 
09:23:31.000000000 +0200
@@ -1,11 +1,13 @@
 ## Projects using Cobra
 
 - [Allero](https://github.com/allero-io/allero)
+- [Arewefastyet](https://benchmark.vitess.io)
 - [Arduino CLI](https://github.com/arduino/arduino-cli)
 - [Bleve](https://blevesearch.com/)
 - [Cilium](https://cilium.io/)
 - [CloudQuery](https://github.com/cloudquery/cloudquery)
 - [CockroachDB](https://www.cockroachlabs.com/)
+- [Constellation](https://github.com/edgelesssys/constellation)
 - [Cosmos SDK](https://github.com/cosmos/cosmos-sdk)
 - [Datree](https://github.com/datreeio/datree)
 - [Delve](https://github.com/derekparker/delve)
@@ -25,7 +27,7 @@
 - [Istio](https://istio.io)
 - [Kool](https://github.com/kool-dev/kool)
 - [Kubernetes](https://kubernetes.io/)
-- [Kubescape](https://github.com/armosec/kubescape)
+- [Kubescape](https://github.com/kubescape/kubescape)
 - [KubeVirt](https://github.com/kubevirt/kubevirt)
 - [Linkerd](https://linkerd.io/)
 - [Mattermost-server](https://github.com/mattermost/mattermost-server)
@@ -51,10 +53,12 @@
 - [Random](https://github.com/erdaltsksn/random)
 - [Rclone](https://rclone.org/)
 - [Scaleway CLI](https://github.com/scaleway/scaleway-cli)
+- [Sia](https://github.com/SiaFoundation/siad)
 - [Skaffold](https://skaffold.dev/)
 - [Tendermint](https://github.com/tendermint/tendermint)
 - [Twitch CLI](https://github.com/twitchdev/twitch-cli)
 - [UpCloud CLI (`upctl`)](https://github.com/UpCloudLtd/upcloud-cli)
+- [Vitess](https://vitess.io)
 - VMware's [Tanzu Community 
Edition](https://github.com/vmware-tanzu/community-edition) & [Tanzu 
Framework](https://github.com/vmware-tanzu/tanzu-framework)
 - [Werf](https://werf.io/)
 - [ZITADEL](https://github.com/zitadel/zitadel)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/shell_completions.go 
new/vendor/github.com/spf13/cobra/shell_completions.go
--- old/vendor/github.com/spf13/cobra/shell_completions.go      2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/shell_completions.go      2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/shell_completions.md 
new/vendor/github.com/spf13/cobra/shell_completions.md
--- old/vendor/github.com/spf13/cobra/shell_completions.md      2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/shell_completions.md      2023-04-13 
09:23:31.000000000 +0200
@@ -71,7 +71,7 @@
 `,cmd.Root().Name()),
        DisableFlagsInUseLine: true,
        ValidArgs:             []string{"bash", "zsh", "fish", "powershell"},
-       Args:                  cobra.ExactValidArgs(1),
+       Args:                  cobra.MatchAll(cobra.ExactArgs(1), 
cobra.OnlyValidArgs),
        Run: func(cmd *cobra.Command, args []string) {
                switch args[0] {
                case "bash":
@@ -162,16 +162,7 @@
 }
 ```
 
-The aliases are not shown to the user on tab completion, but they are accepted 
as valid nouns by
-the completion algorithm if entered manually, e.g. in:
-
-```bash
-$ kubectl get rc [tab][tab]
-backend        frontend       database
-```
-
-Note that without declaring `rc` as an alias, the completion algorithm would 
not know to show the list of
-replication controllers following `rc`.
+The aliases are shown to the user on tab completion only if no completions 
were found within sub-commands or `ValidArgs`.
 
 ### Dynamic completion of nouns
 
@@ -237,6 +228,10 @@
 //    return []string{"themes"}, ShellCompDirectiveFilterDirs
 //
 ShellCompDirectiveFilterDirs
+
+// ShellCompDirectiveKeepOrder indicates that the shell should preserve the 
order
+// in which the completions are provided
+ShellCompDirectiveKeepOrder
 ```
 
 ***Note***: When using the `ValidArgsFunction`, Cobra will call your 
registered function after having parsed all flags and arguments provided in the 
command-line.  You therefore don't need to do this parsing yourself.  For 
example, when a user calls `helm status --namespace my-rook-ns [tab][tab]`, 
Cobra will call your registered `ValidArgsFunction` after having parsed the 
`--namespace` flag, as it would have done when calling the `RunE` function.
@@ -385,6 +380,19 @@
 ```go
 ValidArgs: []string{"bash\tCompletions for bash", "zsh\tCompletions for zsh"}
 ```
+
+If you don't want to show descriptions in the completions, you can add 
`--no-descriptions` to the default `completion` command to disable them, like:
+
+```bash
+$ source <(helm completion bash)
+$ helm completion [tab][tab]
+bash        (generate autocompletion script for bash)        powershell  
(generate autocompletion script for powershell)
+fish        (generate autocompletion script for fish)        zsh         
(generate autocompletion script for zsh)
+
+$ source <(helm completion bash --no-descriptions)
+$ helm completion [tab][tab]
+bash        fish        powershell  zsh
+```
 ## Bash completions
 
 ### Dependencies
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/user_guide.md 
new/vendor/github.com/spf13/cobra/user_guide.md
--- old/vendor/github.com/spf13/cobra/user_guide.md     2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/user_guide.md     2023-04-13 
09:23:31.000000000 +0200
@@ -188,6 +188,37 @@
 }
 ```
 
+### Organizing subcommands
+
+A command may have subcommands which in turn may have other subcommands. This 
is achieved by using
+`AddCommand`. In some cases, especially in larger applications, each 
subcommand may be defined in
+its own go package.
+
+The suggested approach is for the parent command to use `AddCommand` to add 
its most immediate
+subcommands. For example, consider the following directory structure:
+
+```text
+├── cmd
+│   ├── root.go
+│   └── sub1
+│       ├── sub1.go
+│       └── sub2
+│           ├── leafA.go
+│           ├── leafB.go
+│           └── sub2.go
+└── main.go
+```
+
+In this case:
+
+* The `init` function of `root.go` adds the command defined in `sub1.go` to 
the root command.
+* The `init` function of `sub1.go` adds the command defined in `sub2.go` to 
the sub1 command.
+* The `init` function of `sub2.go` adds the commands defined in `leafA.go` and 
`leafB.go` to the
+  sub2 command.
+
+This approach ensures the subcommands are always included at compile time 
while avoiding cyclic
+references.
+
 ### Returning and handling errors
 
 If you wish to return an error to the caller of a command, `RunE` can be used.
@@ -313,8 +344,8 @@
 You can also prevent different flags from being provided together if they 
represent mutually
 exclusive options such as specifying an output format as either `--json` or 
`--yaml` but never both:
 ```go
-rootCmd.Flags().BoolVar(&u, "json", false, "Output in JSON")
-rootCmd.Flags().BoolVar(&pw, "yaml", false, "Output in YAML")
+rootCmd.Flags().BoolVar(&ofJson, "json", false, "Output in JSON")
+rootCmd.Flags().BoolVar(&ofYaml, "yaml", false, "Output in YAML")
 rootCmd.MarkFlagsMutuallyExclusive("json", "yaml")
 ```
 
@@ -349,7 +380,7 @@
 ```go
 var cmd = &cobra.Command{
   Short: "hello",
-  Args: MatchAll(ExactArgs(2), OnlyValidArgs),
+  Args: cobra.MatchAll(cobra.ExactArgs(2), cobra.OnlyValidArgs),
   Run: func(cmd *cobra.Command, args []string) {
     fmt.Println("Hello, World!")
   },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/github.com/spf13/cobra/zsh_completions.go 
new/vendor/github.com/spf13/cobra/zsh_completions.go
--- old/vendor/github.com/spf13/cobra/zsh_completions.go        2023-04-03 
14:03:36.000000000 +0200
+++ new/vendor/github.com/spf13/cobra/zsh_completions.go        2023-04-13 
09:23:31.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2013-2022 The Cobra Authors
+// Copyright 2013-2023 The Cobra Authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -90,6 +90,7 @@
                compCmd = ShellCompNoDescRequestCmd
        }
        WriteStringAndCheck(buf, fmt.Sprintf(`#compdef %[1]s
+compdef _%[1]s %[1]s
 
 # zsh completion for %-36[1]s -*- shell-script -*-
 
@@ -108,8 +109,9 @@
     local shellCompDirectiveNoFileComp=%[5]d
     local shellCompDirectiveFilterFileExt=%[6]d
     local shellCompDirectiveFilterDirs=%[7]d
+    local shellCompDirectiveKeepOrder=%[8]d
 
-    local lastParam lastChar flagPrefix requestComp out directive comp 
lastComp noSpace
+    local lastParam lastChar flagPrefix requestComp out directive comp 
lastComp noSpace keepOrder
     local -a completions
 
     __%[1]s_debug "\n========= starting completion logic =========="
@@ -177,7 +179,7 @@
         return
     fi
 
-    local activeHelpMarker="%[8]s"
+    local activeHelpMarker="%[9]s"
     local endIndex=${#activeHelpMarker}
     local startIndex=$((${#activeHelpMarker}+1))
     local hasActiveHelp=0
@@ -227,6 +229,11 @@
         noSpace="-S ''"
     fi
 
+    if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
+        __%[1]s_debug "Activating keep order."
+        keepOrder="-V"
+    fi
+
     if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
         # File extension filtering
         local filteringCmd
@@ -262,7 +269,7 @@
         return $result
     else
         __%[1]s_debug "Calling _describe"
-        if eval _describe "completions" completions $flagPrefix $noSpace; then
+        if eval _describe $keepOrder "completions" completions $flagPrefix 
$noSpace; then
             __%[1]s_debug "_describe found some completions"
 
             # Return the success of having called _describe
@@ -296,6 +303,6 @@
 fi
 `, name, compCmd,
                ShellCompDirectiveError, ShellCompDirectiveNoSpace, 
ShellCompDirectiveNoFileComp,
-               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs,
+               ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, 
ShellCompDirectiveKeepOrder,
                activeHelpMarker))
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/modules.txt new/vendor/modules.txt
--- old/vendor/modules.txt      2023-04-03 14:03:37.000000000 +0200
+++ new/vendor/modules.txt      2023-04-13 09:23:31.000000000 +0200
@@ -97,7 +97,7 @@
 github.com/hashicorp/hcl/json/parser
 github.com/hashicorp/hcl/json/scanner
 github.com/hashicorp/hcl/json/token
-# github.com/inconshreveable/mousetrap v1.0.1
+# github.com/inconshreveable/mousetrap v1.1.0
 ## explicit; go 1.18
 github.com/inconshreveable/mousetrap
 # github.com/josharian/intern v1.0.0
@@ -206,7 +206,7 @@
 # github.com/spf13/cast v1.5.0
 ## explicit; go 1.18
 github.com/spf13/cast
-# github.com/spf13/cobra v1.6.1
+# github.com/spf13/cobra v1.7.0
 ## explicit; go 1.15
 github.com/spf13/cobra
 # github.com/spf13/jwalterweatherman v1.1.0

Reply via email to