diff options
author | Oliver Kiddle <opk@zsh.org> | 2025-01-27 23:00:17 +0100 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2025-01-27 23:00:17 +0100 |
commit | 87aba4d437f5fef46917c1235c00b9162d7bcbd0 (patch) | |
tree | ce578175d1248d14b8237ad86121b9396550c226 /Completion/BSD/Command | |
parent | db01c79cf83290b9ac9d77e66d832551b7022f71 (diff) | |
download | zsh-87aba4d437f5fef46917c1235c00b9162d7bcbd0.tar.gz zsh-87aba4d437f5fef46917c1235c00b9162d7bcbd0.zip |
53325: cover newer BSD releases in completion
Diffstat (limited to 'Completion/BSD/Command')
-rw-r--r-- | Completion/BSD/Command/_acpiconf | 28 | ||||
-rw-r--r-- | Completion/BSD/Command/_bsdconfig | 1 | ||||
-rw-r--r-- | Completion/BSD/Command/_pkgin | 2 | ||||
-rw-r--r-- | Completion/BSD/Command/_procstat | 35 | ||||
-rw-r--r-- | Completion/BSD/Command/_sockstat | 5 | ||||
-rw-r--r-- | Completion/BSD/Command/_systat | 1 |
6 files changed, 55 insertions, 17 deletions
diff --git a/Completion/BSD/Command/_acpiconf b/Completion/BSD/Command/_acpiconf new file mode 100644 index 000000000..817a2f1ad --- /dev/null +++ b/Completion/BSD/Command/_acpiconf @@ -0,0 +1,28 @@ +#compdef acpiconf + +local curcontext="$curcontext" sep ret=1 +local -a state line modes desc +local -A opt_args + +_arguments -s \ + '(-)-h[display usage information]' \ + '(-)-i[get battery information]:battery' \ + '(-)-k[ack or abort a pending suspend]:ack' \ + '(-)-s[enter specified sleep mode]: :->modes' && ret=0 + +if [[ -n $state ]]; then + modes=( $(_call_program modes sysctl -n hw.acpi.supported_sleep_state) ) + zstyle -s ":completion:${curcontext}:modes" list-separator sep || sep=-- + (( $#modes )) || modes=( S3 S4 ) + desc=( + "S1 $sep stop the processor clock" + "S2 $sep low wake latency sleep state" + "S3 $sep suspend to RAM" + "S4 $sep suspend to disk" + "S5 $sep soft off state" + ) + desc=( ${(M)desc:#(${(~j.|.)modes}) *} ) + _wanted modes expl 'mode' compadd -M 'B:S=' -ld desc - ${modes#S} && ret=0 +fi + +return ret diff --git a/Completion/BSD/Command/_bsdconfig b/Completion/BSD/Command/_bsdconfig index f88255575..5de8f777d 100644 --- a/Completion/BSD/Command/_bsdconfig +++ b/Completion/BSD/Command/_bsdconfig @@ -51,6 +51,7 @@ shortcuts=( vt_saver vt_screenmap vt_ttys + wifi wireless wlan ) _arguments -s -w -A '-*' : \ diff --git a/Completion/BSD/Command/_pkgin b/Completion/BSD/Command/_pkgin index 662bed181..c4ed3aa14 100644 --- a/Completion/BSD/Command/_pkgin +++ b/Completion/BSD/Command/_pkgin @@ -5,6 +5,8 @@ local -a state state_descr line expl cmds short pkgs local -A opt_args _arguments -s -S -C \ + '(-6)-4[only use IPv4 addresses]' \ + '(-4)-6[only use IPv6 addresses]' \ '-c+[enable chrooting pkgin in the given repository]:chroot path:_directories' \ '-d[download only]' \ '-f[force database update]' \ diff --git a/Completion/BSD/Command/_procstat b/Completion/BSD/Command/_procstat index a1708f6ac..867ddc501 100644 --- a/Completion/BSD/Command/_procstat +++ b/Completion/BSD/Command/_procstat @@ -1,26 +1,27 @@ #compdef procstat _arguments -s -A "-*" -S \ - '-b[show binary information]' \ - '-c[show command line arguments]' \ - '-e[show environment variables]' \ - '-f[show file descriptor information]' \ - '-i[show signal pending and disposition]' \ - '-j[show signal pending and blocked information for process threads]' \ - '-k[show stacks of kernel threads]' \ - '-l[show resource limits]' \ - "-L[show LWP info for the process pertaining to it's signal driven exit]" \ - '-r[show resource usage]' \ - '-s[show security credential information]' \ - '-S[show cpuset information]' \ - '-t[show thread information]' \ - '-v[show virtual memory mappings]' \ - '-x[show ELF auxiliary vector]' \ + '(1)-b[show binary information]' \ + '(1)-c[show command line arguments]' \ + '(1)-e[show environment variables]' \ + '(1)-f[show file descriptor information]' \ + '(1)-i[show signal pending and disposition]' \ + '(1)-j[show signal pending and blocked information for process threads]' \ + '(1)-k[show stacks of kernel threads]' \ + '(1)-l[show resource limits]' \ + "(1)-L[show LWP info for the process pertaining to it's signal driven exit]" \ + '(1)-r[show resource usage]' \ + '(1)-s[show security credential information]' \ + '(1)-S[show cpuset information]' \ + '(1)-t[show thread information]' \ + '(1)-v[show virtual memory mappings]' \ + '(1)-x[show ELF auxiliary vector]' \ '-h[suppress table headers]' \ - '(1)-a[all processes]' \ + '(2 *)-a[all processes]' \ '-w+[repeat information after specified interval]:delay (seconds)' \ '-C[print additional capability information for file descriptors]' \ '-H[statistics per-thread rather than per-process]' \ '-n[numeric form for signals]' \ - '1::core file:_path_files -g "*core*(-.)"' \ + '1::command:(advlock argument auxv basic binary cpuset credential environment fd file kstack pargs ptlwpinfo pwdx rlimit rlimitusage rusage sigfastblock signal thread tsignal vm)' \ + '2::core file:_path_files -g "*core*(-.)"' \ '*:process id:_pids' diff --git a/Completion/BSD/Command/_sockstat b/Completion/BSD/Command/_sockstat index f372fe1b3..b99d3681a 100644 --- a/Completion/BSD/Command/_sockstat +++ b/Completion/BSD/Command/_sockstat @@ -29,6 +29,11 @@ case $OSTYPE in '-q[quiet mode, do not print the header line]' ) ;| + freebsd<14->.*) + args+=( + '-I[show local address of socket to which the current socket is spliced]' + ) + ;| freebsd*) for proto in ${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}}; do case $proto in diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat index 03df07631..fcb5565d7 100644 --- a/Completion/BSD/Command/_systat +++ b/Completion/BSD/Command/_systat @@ -79,6 +79,7 @@ case $OSTYPE in "-n[don't resolve IP addresses]" '(-b)-w[refresh interval]:refresh interval' "(-b)-t[specify amount of refreshes for each screen in 'all' display mode]:turns" + '-z[display 0 instead of space when there is no data]' ) esac |