From 985952e2f616c816e24c4cf5aee70416e4f23e07 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 11 Oct 2023 00:57:16 +0200 Subject: 52217: update completions for FreeBSD 14 --- Completion/Unix/Command/_sysctl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_sysctl') diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl index 0416ca05e..442953c4d 100644 --- a/Completion/Unix/Command/_sysctl +++ b/Completion/Unix/Command/_sysctl @@ -28,6 +28,12 @@ case $OSTYPE in '(- :)'{-V,--version}'[display version info and exit]' \ '*:sysctl variable:_files -W /proc/sys' ;; + freebsd<14->.*) + args+=( + '-F[print the format of the variable]' + '(-N)-l[show the length of variables along with their values]' + ) + ;| freebsd<11->.*) args+=( '-B[specify buffer size for reading]:buffer size' @@ -53,7 +59,7 @@ case $OSTYPE in '-d[print the description of the variable instead of its value]' \ '(-N -n)-e[separate name and value with =]' \ "-i[silently exit if variable doesn't exist]" \ - '(-n)-N[show only variable names]' \ + '(-n -l)-N[show only variable names]' \ '(-N)-n[show only variable values]' \ '(-x)-o[show opaques as well (values suppressed)]' \ '-q[suppress some warnings]' \ -- cgit v1.2.3 From 9b8af0900fd8167543e5786b46e70d3f32d45e2b Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Mon, 11 Nov 2024 09:27:52 -0500 Subject: 53144: _sysctl: support completion with the dot delimiter on linux --- ChangeLog | 5 +++++ Completion/Unix/Command/_sysctl | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_sysctl') diff --git a/ChangeLog b/ChangeLog index 35b01f95e..a0e742244 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-11-11 Eric Cook + + * 53144: Completion/Unix/Command/_sysctl: + support completion with the dot delimiter on linux + 2024-11-05 Bart Schaefer * 53209 + comments + test: Src/params.c, Test/D04parameter.ztst: diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl index 442953c4d..09995c98e 100644 --- a/Completion/Unix/Command/_sysctl +++ b/Completion/Unix/Command/_sysctl @@ -23,10 +23,18 @@ case $OSTYPE in else args=( ${args:#((#s)|*\))(\*|)--*} ) # remove long options fi + local delimiter=. + sysctlvars=( /proc/sys/**/*(.e*'REPLY=${REPLY#/proc/sys/}'*) ) + if zstyle -t ":completion:${curcontext}:argument-rest" delimiter / || (( ${words[CURRENT][(Ie)/]} )); then + delimiter=/ + else + sysctlvars=(${sysctlvars//\//.}) + fi + _arguments -S -A "-*" : $args \ '(- :)'{-h,--help}'[display help text and exit]' \ '(- :)'{-V,--version}'[display version info and exit]' \ - '*:sysctl variable:_files -W /proc/sys' + "*:sysctl variable:_multi_parts -i -S = -q $delimiter sysctlvars" ;; freebsd<14->.*) args+=( -- cgit v1.2.3