Skip to content

Commit

Permalink
tshark: update -T and -t completions
Browse files Browse the repository at this point in the history
The new -t values are available since 1.12 while the the most recent -T
value was added in 2.4. Current as of v2.9.0rc0-2173-g9fcb4af6b6.
Hardcode options as executing tshark can be slow while the options do
not change that option.
  • Loading branch information
Lekensteyn authored and scop committed Oct 11, 2018
1 parent 46ff7b3 commit 5869351
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions completions/tshark
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ _tshark()
return
;;
-*T)
# TODO: could be parsed from "-T ." output
COMPREPLY=( $( compgen -W 'ps text pdml psml fields' -- "$cur" ) )
# Parse from: tshark -T . 2>&1 | awk -F \" '/^\t*"/ { print $2 }'
COMPREPLY=( $( compgen -W \
'pdml ps psml json jsonraw ek tabs text fields' -- "$cur" ) )
return
;;
-*t)
# TODO: could be parsed from "-t ." output
COMPREPLY=( $( compgen -W 'ad a r d dd e' -- "$cur" ) )
# Parse from: tshark -t . 2>&1 | awk -F \" '/^\t*"/ { print $2 }'
COMPREPLY=( $( compgen -W \
'a ad adoy d dd e r u ud udoy' -- "$cur" ) )
return
;;
-*u)
Expand Down

0 comments on commit 5869351

Please sign in to comment.