diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-13 11:24:41 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-05-13 12:27:03 +0200 |
commit | 2b100f7515dbd01032967c2d1b81d2f8d63bf9b5 (patch) | |
tree | 968b9a17fc20f92c0d58cdd11ed49815d8b818f5 /ifpps.zsh | |
parent | c59245ddcc0541edca71769b3153bc13580a5bbb (diff) |
zsh: add netsniff-ng zsh auto completion support
Hideo Hattori wrote a set of auto completion scripts for zsh that
support netsniff-ng tools. Big thanks for that! Follow-up commits
still need to address updated command-line options.
Signed-off-by: Hideo Hattori <hhatto.jp@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'ifpps.zsh')
-rw-r--r-- | ifpps.zsh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ifpps.zsh b/ifpps.zsh new file mode 100644 index 0000000..a4a4a5d --- /dev/null +++ b/ifpps.zsh @@ -0,0 +1,29 @@ +#compdef ifpps +# +# ifpps.zsh -- zsh completion function for ifpps +# +# Copyright (C) 2013 Hideo Hattori <hhatto.jp@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. + +typeset -A opt_args + +_interfaces () { + _wanted interfaces expl 'network interface' \ + _net_interfaces + _values "Pseudo-device that captures on all interfaces" "any" +} + +_arguments -s -S \ + "(-d --dev)"{-d,--dev}"[Device to fetch statistics for i.e., eth0]:device:_interfaces" \ + "(-p --promisc)"{-p,--promisc}"[Promiscuous mode]" \ + "(-t --interval)"{-t,--interval}"[Refresh time in sec (default 1 s)]:interval:_gnu_generic" \ + "(-c --term)"{-c,--term}"[Output to terminal]" \ + "(-C --csv)"{-C,--csv}"[Output to terminal as CSV E.g. post-processing with Gnuplot et al.]" \ + "(-H --csv-tablehead)"{-H,--csv-tablehead}"[Print CSV table head]" \ + "(-l --loop)"{-l,--loop}"[Loop terminal output]" \ + {-v,--version}"[Print version]:" \ + {-h,--help}"[Print this help]:" \ + "*::args:_gnu_generic" |