Skip to content

Commit dfacd2b

Browse files
committed
fix(tshark): rename "_cmp_cmd_tshark__{ => mut_}{prefs,protocols}"
"_comp_cmd_tshark__{prefs,protocols}" are mutable global variables used to cache the prefixes and protocols, so they should have "_mut_" in the variable names.
1 parent dd5cf12 commit dfacd2b

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

completions-core/tshark.bash

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ _comp_cmd_tshark()
2222
if [[ $cur == *:* ]]; then
2323
_comp_compgen -c "${cur#*:}" filedir
2424
else
25-
[[ -v _comp_cmd_tshark__prefs ]] ||
26-
_comp_cmd_tshark__prefs=$("$1" -G defaultprefs 2>/dev/null |
25+
[[ -v _comp_cmd_tshark__mut_prefs ]] ||
26+
_comp_cmd_tshark__mut_prefs=$("$1" -G defaultprefs 2>/dev/null |
2727
command sed -ne 's/^#\{0,1\}\([a-z0-9_.-]\{1,\}:\).*/\1/p')
28-
_comp_compgen -P "$prefix" -- -W "$_comp_cmd_tshark__prefs"
28+
_comp_compgen -P "$prefix" -- -W "$_comp_cmd_tshark__mut_prefs"
2929
[[ ${COMPREPLY-} == *: ]] && compopt -o nospace
3030
fi
3131
return
@@ -70,10 +70,10 @@ _comp_cmd_tshark()
7070
return
7171
;;
7272
-*O)
73-
[[ -v _comp_cmd_tshark__protocols ]] ||
74-
_comp_cmd_tshark__protocols=$("$1" -G protocols 2>/dev/null |
73+
[[ -v _comp_cmd_tshark__mut_protocols ]] ||
74+
_comp_cmd_tshark__mut_protocols=$("$1" -G protocols 2>/dev/null |
7575
cut -f 3)
76-
_comp_delimited , -W "$_comp_cmd_tshark__protocols"
76+
_comp_delimited , -W "$_comp_cmd_tshark__mut_protocols"
7777
return
7878
;;
7979
-*T)

test/t/test_tshark.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22

33

4-
@pytest.mark.bashcomp(ignore_env=r"^\+_comp_cmd_tshark__pr(ef|otocol)s=")
54
class TestTshark:
65
@pytest.mark.complete("tshark -", require_cmd=True)
76
def test_1(self, completion):

0 commit comments

Comments
 (0)