diff options
Diffstat (limited to 'Completion/Unix')
-rw-r--r-- | Completion/Unix/Command/_cat | 3 | ||||
-rw-r--r-- | Completion/Unix/Command/_sysctl | 22 | ||||
-rw-r--r-- | Completion/Unix/Command/_vmstat | 26 | ||||
-rw-r--r-- | Completion/Unix/Command/_zfs | 34 | ||||
-rw-r--r-- | Completion/Unix/Type/_zfs_dataset | 6 |
5 files changed, 48 insertions, 43 deletions
diff --git a/Completion/Unix/Command/_cat b/Completion/Unix/Command/_cat index e223d90d9..57b197038 100644 --- a/Completion/Unix/Command/_cat +++ b/Completion/Unix/Command/_cat @@ -30,6 +30,9 @@ elif [[ "$OSTYPE" == (freebsd|dragonfly|darwin)* ]]; then '-v[display non-printing chars as ^X or M-a]' '(-)*:files:_files' ) + [[ $OSTYPE = freebsd* ]] && args+=( + '-l[set a lock on the stdout file descriptor]' + ) else # POSIX reqires '-u', and most OSes may support '-n' diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl index 9d9e8b968..cf88c3dc1 100644 --- a/Completion/Unix/Command/_sysctl +++ b/Completion/Unix/Command/_sysctl @@ -1,21 +1,39 @@ #compdef sysctl +local -a args + case $OSTYPE in + freebsd<10->.*) + args+=( + '-f+[specify file of name/value pairs to process first]:file:_files' + '-T[display only variables that are setable via loader]' + '-W[display only writable variables that are not statistical]' + ) + ;| + dragonfly*|freebsd<8->.*) + args+=( "-i[silently exit if variable doesn't exist]" ) + ;| *freebsd<5->.*|freebsd4.[4-9]*) local -a sysctlvars sysctlvars=( $(_call_program sysctl-variables sysctl -aN) ) - _arguments -s -A "-*" \ + _arguments -s -S -A "-*" $args \ + '(-a -o *)-A[equivalent to -o -a (for compatibility)]' \ '(*)-a[list all]' \ '-b[binary output]' \ + '-d[print the description of the variable instead of its value]' \ + '(-N -n)-e[separate name and value with =]' \ + '-h[format output for human readability]' \ '(-n)-N[show only variable names]' \ '(-N)-n[show only variable values]' \ '(-x)-o[show opaques as well (values suppressed)]' \ + '-q[suppress some warnings]' \ + '(* -o)-X[equivalent to -x -a (for compatibility)]' \ '(-o)-x[show opaques as well (entire values)]' \ '(-a)*:sysctl variable:_multi_parts -i . sysctlvars' ;; freebsd[0-4].*|darwin*|dragonfly*) : ${(A)_cache_sysctlvars:=${${$(sysctl -A 2>/dev/null):#[^a-z]*}%%:*}} - _arguments -s -A "-*" \ + _arguments -s -A "-*" $args \ '(-w -X *)-a[list all]' \ '(-w -X *)-A[show all opaques (values suppressed)]' \ '(-w)-b[binary output]' \ diff --git a/Completion/Unix/Command/_vmstat b/Completion/Unix/Command/_vmstat index 02fa6be64..7082cbbd5 100644 --- a/Completion/Unix/Command/_vmstat +++ b/Completion/Unix/Command/_vmstat @@ -18,40 +18,38 @@ case $OSTYPE in '1:delay' '2:count' ) ;; - freebsd*) + freebsd*|openbsd*) specs=( - '-a[include statistics about all interrupts]' '-c[number of times to refresh the display]:count' '-f[report on the number fork syscalls since boot and pages of virtual memory for each]' - '-h[human readable memory columns output]' - '-H[scriptable memory columns output]' '-i[report the number of interrupts taken by devices since boot]' '-M[source file to extract values associated with the name list from]:core:_files' '-N[source file to extract the name list from]:system:_files' + '-w[specify delay between each display]:delay (seconds)' + '*:disk:_files' + ) + ;| + freebsd*) + specs+=( + '-a[include statistics about all interrupts]' + '-h[human readable memory columns output]' + '-H[scriptable memory columns output]' '-m[report on the usage of kernel dynamic memory allocated using malloc(9) by type]' '-n[change the maximum number of disks to display]:number of disks to display' + '-o[list virtual memory objects]' '-P[report per-cpu system/user/idle cpu statistics]' '-p[specify which types of devices to display]: :->devices' '-s[display the contents of the SUM structure]:sum' - '-w[delay N seconds between each display]:delay' '-z[report on memory used by the kernel zone allocator, uma(9), by zone]' - '*:disks:_files' ) ;; openbsd*) - specs=( - '-c[number of times to refresh the display]:count' - '-f[report on the number fork syscalls since boot and pages of virtual memory for each]' - '-i[report the number of interrupts taken by devices since boot]' - '-M[source file to extract values associated with the name list from]:core:_files' + specs+=( '-m[report usage of kernel dynamic memory listed first by size of allocation then type of usage]' - '-N[source file to extract the name list from]:system:_files' '-s[display the contents of the UVMEXP structure]:uvmexp' '-t[report on the number of page in and page reclaims since boot]' '-v[print more verbose information]' - '-w[delay N seconds between each display]:delay' '-z[include statistics about all interrupts]' - '*:disks:_files' ) ;; esac diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index f3869da43..553996da0 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -149,7 +149,7 @@ _zfs() { "atime:value:(on off)" "canmount:value:(on off noauto)" "checksum:value:(on off fletcher2 fletcher4 sha256 sha256+mac)" - "compression:value:(on off lzjb gzip gzip-{1..9} zle)" + "compression:value:(on off lzjb lz4 gzip gzip-{1..9} zle)" "copies:value:(1 2 3)" "dedup:value:(on off verify sha256 sha256,verify)" "devices:value:(on off)" @@ -247,7 +247,7 @@ _zfs() { ':filesystem/volume/snapshot:_zfs_dataset -t fs -t vol' ;; - ("snapshot") + (snap(|shot)) _arguments -A "-*" \ '-r[Recursively snapshot all descendant datasets]' \ '*-o[Set property]:property:_values -s , "property" $create_properties' \ @@ -418,30 +418,16 @@ _zfs() { ("allow") _arguments -A "-*" \ - - set1 \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - - set2 \ - '(-g)-u[User]:user:_users' \ - '(-u)-g[Group]:group:_groups' \ - '-l[Allow for named dataset]' \ - '-d[Allow for descendent datasets]' \ + '(1 -g -e -c -s)-u[delegate to user]:user:_users' \ + '(1 -u -e -c -s)-g[delegate to group]:group:_groups' \ + '(1 -g -u -c -s)-e[delegate to everyone]' \ + '(1 -u -g -e -l -d -s)-c[set permissions for newly-created descendant filesystems]' \ + '(1 -u -g -e -l -d -c)-s[define or modify permission sets]:permission set' \ + '(1 -c -s)-l[allow for named dataset]' \ + '(1 -c -s)-d[allow for descendent datasets]' \ + '1::filesystem/volume:_zfs_dataset -t fs -t vol' \ ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - - set3 \ - '-e[Everyone]' \ - '-l[Allow for named dataset]' \ - '-d[Allow for descendent datasets]' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - - set4 \ - '-c[Create-time permissions]' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - - set5 \ - '-s[Define or modify permission sets]' \ - ':setname:' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' ;; ("unallow") diff --git a/Completion/Unix/Type/_zfs_dataset b/Completion/Unix/Type/_zfs_dataset index 5fa3e9e50..6c625e9ec 100644 --- a/Completion/Unix/Type/_zfs_dataset +++ b/Completion/Unix/Type/_zfs_dataset @@ -58,14 +58,14 @@ if [[ ${#rdst} -gt 0 ]]; then fi if [[ -n $type[(r)clone] ]]; then - datasetlist=( ${="$(zfs list -H -o name,origin -t filesystem | awk "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) + datasetlist=( ${="$(zfs list -H -o name,origin -t filesystem 2>/dev/null | awk "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) else - datasetlist=( ${="$(zfs list -H -o name $typearg)":#no datasets available} ) + datasetlist=( ${="$(zfs list -H -o name $typearg 2>/dev/null)":#no datasets available} ) fi expl_type=${typearg[2,-1]//,/\/} if [[ -n $type[(r)mtpt] ]]; then - mlist=( ${="$(zfs list -H -o mountpoint $typearg)":#no mountpoints available} ) + mlist=( ${="$(zfs list -H -o mountpoint $typearg 2>/dev/null)":#no mountpoints available} ) datasetlist=( $datasetlist $mlist ) expl_type="$expl_type/mountpoint" fi |