Skip to content

Commit 014ec6e

Browse files
fix(gdb): fix regression that fails to generate command names
The current version fails to generate any command names for the first word after the command name "gdb". This is a regression introduced in scop#1086 and pointed out in the comment: scop@73c5292#r138406647 Co-authored-by: Grisha Levit <grishalevit@gmail.com>
1 parent b631277 commit 014ec6e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

completions/gdb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _comp_cmd_gdb()
2626
# functions and aliases. Thus we need to retrieve the program
2727
# names manually.
2828
local path_array
29-
_comp_compgen -Rv path_array split -X '' -- "$PATH"
29+
_comp_compgen -Rv path_array split -F : -X '' -- "$PATH"
3030
_comp_compgen_split -o plusdirs -- "$(
3131
find ${path_array[@]+"${path_array[@]}"} . -mindepth 1 \
3232
-maxdepth 1 -not -type d -executable -printf '%f\n' \

test/t/test_gdb.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ def test_2(self, completion):
1212
"core core.12345 "
1313
"core.weston.1000.deadbeef.5308.1555362132000000".split()
1414
)
15+
16+
@pytest.mark.complete("gdb aw")
17+
def test_3(self, completion):
18+
"""Check that the completion can generate command names"""
19+
assert "awk" in completion
20+
21+
@pytest.mark.complete("gdb built")
22+
def test_4(self, completion):
23+
"""Check that the completion does not generate builtin names"""
24+
assert "builtin" not in completion

0 commit comments

Comments
 (0)