diff options
author | Joe Rayhawk <jrayhawk@fairlystable.org> | 2025-04-30 02:07:56 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@fairlystable.org> | 2025-04-30 02:07:56 -0700 |
commit | 26e09889646be3ea65b4a3dfeda26213e4bb6a27 (patch) | |
tree | 4f3c73a9416bf47ad7e125383d23cf42879e38d7 /Completion/Unix/Command/_sysctl | |
parent | 841bce705a58b04220b1f257abcc00ae71cbdbdc (diff) | |
parent | 001cba48ce3b964cf01fb3e2af54b20eacbc9bf5 (diff) | |
download | zsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.tar.gz zsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.zip |
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_sysctl')
-rw-r--r-- | Completion/Unix/Command/_sysctl | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl index 0416ca05e..09995c98e 100644 --- a/Completion/Unix/Command/_sysctl +++ b/Completion/Unix/Command/_sysctl @@ -23,11 +23,25 @@ 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+=( + '-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 +67,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]' \ |