mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 11:21:13 +02:00
Baptiste: 28819: FreeBSD completion tweaks
This commit is contained in:
parent
6e50d3d7db
commit
6a015133bd
5 changed files with 37 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-03-01 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* Baptiste: 28819: Completion/BSD/Command/_sockstat,
|
||||
Completion/Unix/Command/_mount,
|
||||
Completion/Unix/Type/_file_systems: FreeBSD completion tweaks.
|
||||
|
||||
2011-02-28 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 28823: Src/builtin.c: make it an error to tie the same scalar to
|
||||
|
@ -14276,5 +14282,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5211 $
|
||||
* $Revision: 1.5212 $
|
||||
*****************************************************
|
||||
|
|
|
@ -15,4 +15,5 @@ _portmaster
|
|||
_portsnap
|
||||
_powerd
|
||||
_procstat
|
||||
_sockstat
|
||||
'
|
||||
|
|
23
Completion/BSD/Command/_sockstat
Normal file
23
Completion/BSD/Command/_sockstat
Normal file
|
@ -0,0 +1,23 @@
|
|||
#compdef sockstat
|
||||
|
||||
local tmp_proto protocols proto
|
||||
|
||||
tmp_proto=(${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}})
|
||||
for proto ($tmp_proto) {
|
||||
case $proto in
|
||||
*\#*)
|
||||
protocols=($protocols ${${(j: :)${=proto}}// *\# /:})
|
||||
;;
|
||||
*)
|
||||
protocols=($protocols ${${(j: :)${=proto}}// */})
|
||||
esac
|
||||
}
|
||||
|
||||
_arguments -s \
|
||||
'-4[Show AF_INET (IPv4) sockets]' \
|
||||
'-6[Show AF_INET6 (IPv6) sockets]' \
|
||||
'-c[Show connected sockets]' \
|
||||
'-l[Show listening sockets]' \
|
||||
'-u[Show AF_LOCAL (UNIX) sockets]' \
|
||||
'-p[Only show Internet sockets if the port number is on the specified list]' \
|
||||
'-P[Only show sockets of the specified protocols]:protocols:(($protocols))'
|
|
@ -44,7 +44,8 @@ local args deffs=iso9660 tmp typeops=-t _nfs_access _fs_nfs _nfs_ufs \
|
|||
_fs_ufs _fs_efs _fs_cd9660 _fs_iso9660 _fs_cachefs _fs_s5fs _fs_tmpfs _fs_pcfs \
|
||||
_fs_hsfs _fs_advfs _fs_cdfs _fs_affs _fs_ext2 _fs_fat _fs_ext3 _fs_msdos \
|
||||
_fs_msdosfs _fs_umsdos _fs_vfat _fs_hpfs _fs_ntfs _fs_reiserfs _fs_smbfs \
|
||||
_fs_xfs _fs_std _fs_devfs _fs_fdesc _fs_kernfs _fs_linprocfs _fs_procfs
|
||||
_fs_xfs _fs_std _fs_devfs _fs_fdesc _fs_kernfs _fs_linprocfs _fs_linsysfs \
|
||||
_fs_procfs
|
||||
|
||||
typeset -A opt_args
|
||||
|
||||
|
@ -566,6 +567,7 @@ if (( ! $+_fs_any )); then
|
|||
_fs_fdesc=( "$_fs_std[@]" )
|
||||
_fs_kernfs=( "$_fs_std[@]" )
|
||||
_fs_linprocfs=( "$_fs_std[@]" )
|
||||
_fs_linsysfs=( "$_fs_std[@]" )
|
||||
_fs_procfs=( "$_fs_std[@]" )
|
||||
_fs_msdos=(
|
||||
'shortnames[]'
|
||||
|
@ -868,7 +870,7 @@ devordir)
|
|||
# add glabel devices
|
||||
_glabel=(${(M)${(f)"$(/sbin/glabel list)"}:#*Name:[[:space:]]*/*})
|
||||
for mline ($_glabel);do
|
||||
dev_tmp+=( mline[(w)3] )
|
||||
dev_tmp+=( /dev/$mline[(w)3] )
|
||||
done
|
||||
|
||||
_alternative \
|
||||
|
|
|
@ -21,8 +21,8 @@ case $OSTYPE in
|
|||
ntfs null nwfs portal procfs std udf ufs umap union )
|
||||
;;
|
||||
freebsd*)
|
||||
fss=( cd9660 devfs ext2fs fdesc kernfs linprocfs mfs msdosfs nfs
|
||||
ntfs nullfs nwfs portal procfs smbfs std udf ufs umap unionfs
|
||||
fss=( cd9660 devfs ext2fs fdescfs kernfs linprocfs linsysfs mfs msdosfs nfs
|
||||
ntfs nullfs nwfs portalfs procfs smbfs std udf ufs unionfs
|
||||
reiserfs xfs)
|
||||
;;
|
||||
darwin*)
|
||||
|
|
Loading…
Reference in a new issue