summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_sysctl
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_sysctl')
-rw-r--r--Completion/Unix/Command/_sysctl18
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]' \