File: _iftop

package info (click to toggle)
zsh 5.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,856 kB
  • sloc: ansic: 108,138; sh: 6,976; makefile: 722; perl: 687; awk: 291; sed: 16
file content (27 lines) | stat: -rw-r--r-- 918 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#compdef iftop

_interfaces () {
  local disp expl sep
  _description interfaces expl 'network interface'
  _net_interfaces "$expl[@]"
  if zstyle -t ":completion:${curcontext}:interfaces" verbose; then
    zstyle -s ":completion:${curcontext}:interfaces" list-separator sep || sep=--
    disp=( "any $sep capture on all interfaces" )
    compadd "$expl[@]" -ld disp any
  else
    compadd "$expl[@]" any
  fi
}

_arguments \
  '(-h -n -N -p -b -B -P -i -f -F -c)'-h'[print a summary of usage]' \
  -n"[don't do hostname lookups]" \
  -N"[don't resolve port number to service names]" \
  -p'[run in promiscuous mode]' \
  -P'[turn on port display]' \
  -b"[don't display bar graphs of traffic]" \
  -B'[display bandwidth rates in bytes/sec rather than bits/sec]' \
  '-i+[interface]:network interface:_interfaces' \
  '-f+[filter]:BPF filter' \
  '-F+[net/mask]:network/mask' \
  '-c+[config file]:config file:_files'