mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 10:41:11 +02:00
53144: _sysctl: support completion with the dot delimiter on linux
This commit is contained in:
parent
f282ff5792
commit
9b8af0900f
2 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2024-11-11 Eric Cook <llua@gmx.com>
|
||||||
|
|
||||||
|
* 53144: Completion/Unix/Command/_sysctl:
|
||||||
|
support completion with the dot delimiter on linux
|
||||||
|
|
||||||
2024-11-05 Bart Schaefer <schaefer@toltec-ubuntu>
|
2024-11-05 Bart Schaefer <schaefer@toltec-ubuntu>
|
||||||
|
|
||||||
* 53209 + comments + test: Src/params.c, Test/D04parameter.ztst:
|
* 53209 + comments + test: Src/params.c, Test/D04parameter.ztst:
|
||||||
|
|
|
@ -23,10 +23,18 @@ case $OSTYPE in
|
||||||
else
|
else
|
||||||
args=( ${args:#((#s)|*\))(\*|)--*} ) # remove long options
|
args=( ${args:#((#s)|*\))(\*|)--*} ) # remove long options
|
||||||
fi
|
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 \
|
_arguments -S -A "-*" : $args \
|
||||||
'(- :)'{-h,--help}'[display help text and exit]' \
|
'(- :)'{-h,--help}'[display help text and exit]' \
|
||||||
'(- :)'{-V,--version}'[display version info 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->.*)
|
freebsd<14->.*)
|
||||||
args+=(
|
args+=(
|
||||||
|
|
Loading…
Reference in a new issue