Skip to content

Commit a452aee

Browse files
committed
fix(available_interfaces): strip only trailing colon from entries
Leave other punctuation alone, at least for now. Closes #1133
1 parent 53fdce4 commit a452aee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@ _comp_compgen_available_interfaces()
17371737
fi
17381738
} 2>/dev/null | _comp_awk \
17391739
'/^[^ \t]/ { if ($1 ~ /^[0-9]+:/) { print $2 } else { print $1 } }')" &&
1740-
_comp_compgen -U generated set "${generated[@]%%[[:punct:]]*}"
1740+
_comp_compgen -U generated set "${generated[@]%:}"
17411741
}
17421742

17431743
# Echo number of CPUs, falling back to 1 on failure.

test/t/unit/test_unit_compgen_available_interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def test_1_trailing_colons(self, bash, functions):
2222
"_comp__test_compgen available_interfaces",
2323
want_output=True,
2424
)
25-
assert ":" not in output.strip()
25+
assert ":>" not in output.strip()

0 commit comments

Comments
 (0)