Skip to content

Commit 4feb50a

Browse files
committed
refactor(tshark): use _comp_compgen -P for -[oX]-...
1 parent fb1ccec commit 4feb50a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

completions/tshark

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ _comp_cmd_tshark()
2626
_comp_cmd_tshark__prefs="$("$1" -G defaultprefs 2>/dev/null | command sed -ne 's/^#\{0,1\}\([a-z0-9_.-]\{1,\}:\).*/\1/p' |
2727
tr '\n' ' ')"
2828
: ${prefix:=}
29-
_comp_compgen -c "${cur:${#prefix}}" -- -P "$prefix" \
30-
-W "$_comp_cmd_tshark__prefs"
29+
_comp_compgen -P "$prefix" -- -W "$_comp_cmd_tshark__prefs"
3130
[[ ${COMPREPLY-} == *: ]] && compopt -o nospace
3231
fi
3332
return
@@ -101,8 +100,7 @@ _comp_cmd_tshark()
101100
if [[ ${cur:${#prefix}} == lua_script:* ]]; then
102101
_comp_compgen -c "${cur#*:}" filedir lua
103102
else
104-
_comp_compgen -c "${cur:${#prefix}}" -- -P "$prefix" \
105-
-W 'lua_script:'
103+
_comp_compgen -P "$prefix" -- -W 'lua_script:'
106104
[[ ${COMPREPLY-} == *: ]] && compopt -o nospace
107105
fi
108106
return

0 commit comments

Comments
 (0)