Skip to content

Commit 50f52f7

Browse files
committed
tshark: fix completion of -Xlua_script option
Treat "-Xlua_script" as "-X lua_script:".
1 parent 9b4098f commit 50f52f7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

completions/tshark

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ _tshark()
99
-o*)
1010
prefix=-o
1111
;;
12+
-X*)
13+
prefix=-X
14+
;;
1215
esac
1316

1417
case ${prefix:-$prev} in
@@ -103,11 +106,12 @@ _tshark()
103106
return
104107
;;
105108
-*X)
106-
if [[ $cur == lua_script:* ]]; then
109+
if [[ ${cur:${#prefix}} == lua_script:* ]]; then
107110
cur=${cur#*:}
108111
_filedir lua
109112
else
110-
COMPREPLY=( $( compgen -W 'lua_script:' -- "$cur" ) )
113+
COMPREPLY=( $( compgen -P "$prefix" -W 'lua_script:' -- \
114+
"${cur:${#prefix}}" ) )
111115
[[ $COMPREPLY == *: ]] && compopt -o nospace
112116
fi
113117
return

0 commit comments

Comments
 (0)