Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] base-files: add zsh completions for vkpurge
@ 2024-02-10  8:00 classabbyamp
  2024-02-10  8:02 ` [PR PATCH] [Updated] " classabbyamp
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: classabbyamp @ 2024-02-10  8:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages vkpurge-zsh-comp
https://github.com/void-linux/void-packages/pull/48638

base-files: add zsh completions for vkpurge
#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/48638.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-vkpurge-zsh-comp-48638.patch --]
[-- Type: text/x-diff, Size: 1719 bytes --]

From 26986bd6d2b818b9ad544f66aec9c5ddf7aee41b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 10 Feb 2024 02:56:34 -0500
Subject: [PATCH] base-files: update to 0.144

adds zsh completions for vkpurge
---
 srcpkgs/base-files/files/_vkpurge | 30 ++++++++++++++++++++++++++++++
 srcpkgs/base-files/template       |  5 +++--
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/base-files/files/_vkpurge

diff --git a/srcpkgs/base-files/files/_vkpurge b/srcpkgs/base-files/files/_vkpurge
new file mode 100644
index 0000000000000..adc5ae7b1f4e1
--- /dev/null
+++ b/srcpkgs/base-files/files/_vkpurge
@@ -0,0 +1,30 @@
+#compdef vkpurge
+
+_vkpurge() {
+	local line state
+
+	_arguments -C \
+		'1: :->subcmd' \
+		'*::kernel:->kernels'
+
+	case "$state" in
+	subcmd)
+		_values 'subcommand' \
+			'list[List removable kernel versions]' \
+			'rm[Remove removable kernel versions]'
+		;;
+	kernels)
+		case "$line[1]" in
+		list)
+			_arguments '*::version glob: '
+			;;
+		rm)
+			_values 'kernel' \
+				'all[All removable kernels]' \
+				$(vkpurge list all)
+			;;
+		esac
+		;;
+	esac
+
+}
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index c9db827fe55b4..64e756be34dee 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,7 +1,7 @@
 # Template file for 'base-files'
 pkgname=base-files
-version=0.143
-revision=4
+version=0.144
+revision=1
 bootstrap=yes
 depends="xbps-triggers"
 short_desc="Void Linux base system files"
@@ -84,6 +84,7 @@ do_install() {
 	# vkpurge
 	vbin ${FILESDIR}/vkpurge
 	vman ${FILESDIR}/vkpurge.8
+	vcompletion "${FILESDIR}"/_vkpurge zsh vkpurge
 
 	vbin ${FILESDIR}/lsb_release
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR PATCH] [Updated] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
@ 2024-02-10  8:02 ` classabbyamp
  2024-02-10 16:33 ` 0x5c
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: classabbyamp @ 2024-02-10  8:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages vkpurge-zsh-comp
https://github.com/void-linux/void-packages/pull/48638

base-files: add zsh completions for vkpurge
completes subcommands, versions and all for `rm`, and says it expects a version glob for `list` (without completing anything because that would be hard)

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/48638.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-vkpurge-zsh-comp-48638.patch --]
[-- Type: text/x-diff, Size: 1716 bytes --]

From f66bb6ef16b791eb3060d38908aae75417309261 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 10 Feb 2024 02:56:34 -0500
Subject: [PATCH] base-files: update to 0.144

adds zsh completions for vkpurge
---
 srcpkgs/base-files/files/_vkpurge | 29 +++++++++++++++++++++++++++++
 srcpkgs/base-files/template       |  5 +++--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/base-files/files/_vkpurge

diff --git a/srcpkgs/base-files/files/_vkpurge b/srcpkgs/base-files/files/_vkpurge
new file mode 100644
index 0000000000000..a6c06e510f363
--- /dev/null
+++ b/srcpkgs/base-files/files/_vkpurge
@@ -0,0 +1,29 @@
+#compdef vkpurge
+
+_vkpurge() {
+	local line state
+
+	_arguments -C \
+		'1: :->subcmd' \
+		'*::kernel:->kernels'
+
+	case "$state" in
+	subcmd)
+		_values 'subcommand' \
+			'list[List removable kernel versions]' \
+			'rm[Remove removable kernel versions]'
+		;;
+	kernels)
+		case "$line[1]" in
+		list)
+			_arguments '*::version glob: '
+			;;
+		rm)
+			_values 'kernel' \
+				'all[All removable kernels]' \
+				$(vkpurge list all)
+			;;
+		esac
+		;;
+	esac
+}
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index c9db827fe55b4..64e756be34dee 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,7 +1,7 @@
 # Template file for 'base-files'
 pkgname=base-files
-version=0.143
-revision=4
+version=0.144
+revision=1
 bootstrap=yes
 depends="xbps-triggers"
 short_desc="Void Linux base system files"
@@ -84,6 +84,7 @@ do_install() {
 	# vkpurge
 	vbin ${FILESDIR}/vkpurge
 	vman ${FILESDIR}/vkpurge.8
+	vcompletion "${FILESDIR}"/_vkpurge zsh vkpurge
 
 	vbin ${FILESDIR}/lsb_release
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
  2024-02-10  8:02 ` [PR PATCH] [Updated] " classabbyamp
@ 2024-02-10 16:33 ` 0x5c
  2024-02-10 17:43 ` [PR REVIEW] " kymnob
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: 0x5c @ 2024-02-10 16:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#issuecomment-1937057725

Comment:
Works well on my machine

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (5 preceding siblings ...)
  2024-02-10 17:43 ` kymnob
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 17:43 ` kymnob
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485204404

Comment:
> A function calling `_arguments` with at least one action containing a ‘->string' must therefore declare appropriate local parameters:
> 
>     local context state state_descr line
>     typeset -A opt_args
> 
> to prevent `_arguments` from altering the global environment.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (3 preceding siblings ...)
  2024-02-10 17:43 ` kymnob
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 17:43 ` kymnob
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485204289

Comment:
> The option `-C` tells `_arguments` to modify the `curcontext` parameter for an action of the form ‘->state'.  This is the standard parameter used to keep  track  of  the current  context.   Here  it  (and  not the context array) should be made local to the calling function to avoid passing back the modified value and should be initialised to the current value at the start of the function:
> 
>     local curcontext="$curcontext"
> 
> This is useful where it is not possible for multiple states to be valid together.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (4 preceding siblings ...)
  2024-02-10 17:43 ` kymnob
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 17:43 ` kymnob
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485205731

Comment:
Would be nice to distinguish between `vkpurge list` and `vkpurge rm` under the same tag name. The doc says:

> Completion functions for commands  that  have  sub-commands  usually modify this field to contain the name of the command followed by a minus sign and the sub-command.  For example, the completion function for the `cvs` command sets this field to `cvs-add` when completing arguments to the `add` subcommand.

```suggestion
		curcontext="${curcontext%:*:*}:vkpurge-$line[1]:"
		case "$line[1]" in
```

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (7 preceding siblings ...)
  2024-02-10 17:43 ` kymnob
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 17:43 ` kymnob
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485206360

Comment:
From the docs:

> The argument; this indicates which command line or option argument we are completing.  For command arguments this generally takes the form `argument-n`, where  `n`  is the number of the argument, and for arguments to options the form `option-opt-n` where `n` is the number of the argument to option opt.  However, this is only the case if the command line is parsed with standard UNIX-style options and arguments, so many completions do not set this.

So I guess it's fine to leave the argument field empty in this case. But `_values` inserts `values` instead.
```suggestion
			local kernels=(
				'all:all removable kernels'
				$(vkpurge list all)
			)
			_describe -t kenrels 'kernel' kernels
```

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (6 preceding siblings ...)
  2024-02-10 17:43 ` kymnob
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 17:43 ` kymnob
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485204760

Comment:
There is a message later already.
```suggestion
		'*:: :->kernels'
```

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (2 preceding siblings ...)
  2024-02-10 17:43 ` [PR REVIEW] " kymnob
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 17:43 ` kymnob
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485205184

Comment:
Usually the tag name is `commands` or `perfix-commands` in such cases. Looks like `_values` doesn't allow to specify tag name and always defaults to `values`. The context looks a bit messy too:

    tags in context :completion::complete:vkpurge:argument-1:
        values  (_values _vkpurge)
    tags in context :completion::complete:vkpurge:values:
        values  (_values _vkpurge)

```suggestion
		local subcommands=(
			'list:list removable kernel versions'
			'rm:remove removable kernel versions'
		)
		_describe -t commands 'subcommand' subcommands
```

`_values` calls `_describe` under the hood anyway.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (8 preceding siblings ...)
  2024-02-10 17:43 ` kymnob
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 18:35 ` [PR PATCH] [Updated] " classabbyamp
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485203971

Comment:
Adding function definition is redundant in this case. I'm suggesting to remove function definition and decrease indentation by one level. Or add `_vkpurge "$@"` at the end of the file to support autoloading in some emulation mode.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
  2024-02-10  8:02 ` [PR PATCH] [Updated] " classabbyamp
  2024-02-10 16:33 ` 0x5c
@ 2024-02-10 17:43 ` kymnob
  2024-02-10 17:43 ` kymnob
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 17:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485205939

Comment:
According to the `vkpurge(8)` manual page, only the first argument is handled.
```suggestion
			_arguments '1::version glob: '
```

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR PATCH] [Updated] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (9 preceding siblings ...)
  2024-02-10 17:43 ` kymnob
@ 2024-02-10 18:35 ` classabbyamp
  2024-02-10 19:07 ` [PR REVIEW] " kymnob
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: classabbyamp @ 2024-02-10 18:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages vkpurge-zsh-comp
https://github.com/void-linux/void-packages/pull/48638

base-files: add zsh completions for vkpurge
completes subcommands, versions and all for `rm`, and says it expects a version glob for `list` (without completing anything because that would be hard)

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/48638.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-vkpurge-zsh-comp-48638.patch --]
[-- Type: text/x-diff, Size: 1880 bytes --]

From 1c575371f3559e0ebad36908d5bc5be705f51f54 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 10 Feb 2024 02:56:34 -0500
Subject: [PATCH] base-files: update to 0.144

adds zsh completions for vkpurge
---
 srcpkgs/base-files/files/_vkpurge | 34 +++++++++++++++++++++++++++++++
 srcpkgs/base-files/template       |  5 +++--
 2 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/base-files/files/_vkpurge

diff --git a/srcpkgs/base-files/files/_vkpurge b/srcpkgs/base-files/files/_vkpurge
new file mode 100644
index 0000000000000..b98dcf56e8c7e
--- /dev/null
+++ b/srcpkgs/base-files/files/_vkpurge
@@ -0,0 +1,34 @@
+#compdef vkpurge
+
+local context state state_descr line
+typeset -A opt_args
+local curcontext="$curcontext"
+
+_arguments -C \
+	'1: :->subcmd' \
+	'*:: :->kernels'
+
+case "$state" in
+subcmd)
+	local subcommands=(
+		'list:List removable kernel versions'
+		'rm:Remove removable kernel versions'
+	)
+	_describe -t commands subcommand subcommands
+	;;
+kernels)
+	curcontext="${curcontext%:*:*}:vkpurge-$line[1]:"
+	case "$line[1]" in
+	list)
+		_arguments '1::version glob: '
+		;;
+	rm)
+		local kernels=(
+			'all:All removable kernels'
+			$(vkpurge list all)
+		)
+		_describe -t kernels kernel kernels
+		;;
+	esac
+	;;
+esac
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index c9db827fe55b4..64e756be34dee 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,7 +1,7 @@
 # Template file for 'base-files'
 pkgname=base-files
-version=0.143
-revision=4
+version=0.144
+revision=1
 bootstrap=yes
 depends="xbps-triggers"
 short_desc="Void Linux base system files"
@@ -84,6 +84,7 @@ do_install() {
 	# vkpurge
 	vbin ${FILESDIR}/vkpurge
 	vman ${FILESDIR}/vkpurge.8
+	vcompletion "${FILESDIR}"/_vkpurge zsh vkpurge
 
 	vbin ${FILESDIR}/lsb_release
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (11 preceding siblings ...)
  2024-02-10 19:07 ` [PR REVIEW] " kymnob
@ 2024-02-10 19:07 ` kymnob
  2024-02-10 19:08 ` [PR PATCH] [Updated] " classabbyamp
  2024-02-12 16:42 ` [PR PATCH] [Merged]: " classabbyamp
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 19:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485217257

Comment:
[The completion style guide](https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide#L45) states that descriptions should not start with a capital letter. Not a requirement though.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR REVIEW] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (10 preceding siblings ...)
  2024-02-10 18:35 ` [PR PATCH] [Updated] " classabbyamp
@ 2024-02-10 19:07 ` kymnob
  2024-02-10 19:07 ` kymnob
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: kymnob @ 2024-02-10 19:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

New review comment by kymnob on void-packages repository

https://github.com/void-linux/void-packages/pull/48638#discussion_r1485217286

Comment:
ditto

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR PATCH] [Updated] base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (12 preceding siblings ...)
  2024-02-10 19:07 ` kymnob
@ 2024-02-10 19:08 ` classabbyamp
  2024-02-12 16:42 ` [PR PATCH] [Merged]: " classabbyamp
  14 siblings, 0 replies; 16+ messages in thread
From: classabbyamp @ 2024-02-10 19:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages vkpurge-zsh-comp
https://github.com/void-linux/void-packages/pull/48638

base-files: add zsh completions for vkpurge
completes subcommands, versions and all for `rm`, and says it expects a version glob for `list` (without completing anything because that would be hard)

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/48638.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-vkpurge-zsh-comp-48638.patch --]
[-- Type: text/x-diff, Size: 1880 bytes --]

From 5b3fddbd2ede745e6af019104298daf65b71c04d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 10 Feb 2024 02:56:34 -0500
Subject: [PATCH] base-files: update to 0.144

adds zsh completions for vkpurge
---
 srcpkgs/base-files/files/_vkpurge | 34 +++++++++++++++++++++++++++++++
 srcpkgs/base-files/template       |  5 +++--
 2 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/base-files/files/_vkpurge

diff --git a/srcpkgs/base-files/files/_vkpurge b/srcpkgs/base-files/files/_vkpurge
new file mode 100644
index 0000000000000..450bfb1de2820
--- /dev/null
+++ b/srcpkgs/base-files/files/_vkpurge
@@ -0,0 +1,34 @@
+#compdef vkpurge
+
+local context state state_descr line
+typeset -A opt_args
+local curcontext="$curcontext"
+
+_arguments -C \
+	'1: :->subcmd' \
+	'*:: :->kernels'
+
+case "$state" in
+subcmd)
+	local subcommands=(
+		'list:list removable kernel versions'
+		'rm:remove removable kernel versions'
+	)
+	_describe -t commands subcommand subcommands
+	;;
+kernels)
+	curcontext="${curcontext%:*:*}:vkpurge-$line[1]:"
+	case "$line[1]" in
+	list)
+		_arguments '1::version glob: '
+		;;
+	rm)
+		local kernels=(
+			'all:all removable kernels'
+			$(vkpurge list all)
+		)
+		_describe -t kernels kernel kernels
+		;;
+	esac
+	;;
+esac
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index c9db827fe55b4..64e756be34dee 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,7 +1,7 @@
 # Template file for 'base-files'
 pkgname=base-files
-version=0.143
-revision=4
+version=0.144
+revision=1
 bootstrap=yes
 depends="xbps-triggers"
 short_desc="Void Linux base system files"
@@ -84,6 +84,7 @@ do_install() {
 	# vkpurge
 	vbin ${FILESDIR}/vkpurge
 	vman ${FILESDIR}/vkpurge.8
+	vcompletion "${FILESDIR}"/_vkpurge zsh vkpurge
 
 	vbin ${FILESDIR}/lsb_release
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PR PATCH] [Merged]: base-files: add zsh completions for vkpurge
  2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
                   ` (13 preceding siblings ...)
  2024-02-10 19:08 ` [PR PATCH] [Updated] " classabbyamp
@ 2024-02-12 16:42 ` classabbyamp
  14 siblings, 0 replies; 16+ messages in thread
From: classabbyamp @ 2024-02-12 16:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

There's a merged pull request on the void-packages repository

base-files: add zsh completions for vkpurge
https://github.com/void-linux/void-packages/pull/48638

Description:
completes subcommands, versions and all for `rm`, and says it expects a version glob for `list` (without completing anything because that would be hard)

#### Testing the changes
- I tested the changes in this PR: **YES**


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-02-12 16:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-10  8:00 [PR PATCH] base-files: add zsh completions for vkpurge classabbyamp
2024-02-10  8:02 ` [PR PATCH] [Updated] " classabbyamp
2024-02-10 16:33 ` 0x5c
2024-02-10 17:43 ` [PR REVIEW] " kymnob
2024-02-10 17:43 ` kymnob
2024-02-10 17:43 ` kymnob
2024-02-10 17:43 ` kymnob
2024-02-10 17:43 ` kymnob
2024-02-10 17:43 ` kymnob
2024-02-10 17:43 ` kymnob
2024-02-10 17:43 ` kymnob
2024-02-10 18:35 ` [PR PATCH] [Updated] " classabbyamp
2024-02-10 19:07 ` [PR REVIEW] " kymnob
2024-02-10 19:07 ` kymnob
2024-02-10 19:08 ` [PR PATCH] [Updated] " classabbyamp
2024-02-12 16:42 ` [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).