Skip to content

Commit b42b79b

Browse files
committed
refactor: replace compgen -c -d with _comp_compgen_commands
1 parent b9c7b5d commit b42b79b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

bash_completion

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,8 +2581,7 @@ _comp_command_offset()
25812581
_comp_get_words cur
25822582

25832583
if ((COMP_CWORD == 0)); then
2584-
compopt -o filenames
2585-
_comp_compgen -- -d -c
2584+
_comp_compgen_commands
25862585
else
25872586
_comp_dequote "${COMP_WORDS[0]}" || ret=${COMP_WORDS[0]}
25882587
local cmd=$ret compcmd=$ret

completions/_su

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ _comp_cmd_su()
1919
return
2020
;;
2121
-c | --command | --session-command)
22-
compopt -o filenames
23-
_comp_compgen -- -d -c
22+
_comp_compgen_commands
2423
return
2524
;;
2625
esac

completions/gdb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _comp_cmd_gdb()
2020
if _comp_looks_like_path "$cur"; then
2121
# compgen -c works as expected if $cur contains any slashes.
2222
local PATH="$PATH:."
23-
_comp_compgen -- -d -c
23+
_comp_compgen_commands
2424
else
2525
# otherwise compgen -c contains Bash's built-in commands,
2626
# functions and aliases. Thus we need to retrieve the program

0 commit comments

Comments
 (0)