Skip to content

Commit 5557fbe

Browse files
committed
fix(_comp_compgen_sysv_services): do not generate names in subdirs
This is a regression by Ref. [1]. In Ref. [1], I have replaced the combination of "_comp_expand_glob" and "_comp_compgen -- -W" with "_comp_compgen -C -- -f". However, I realized that this strategy would cause generation of the filenames in subdirectories when $cur contains "/" [2]. To avoid this, one can exclude candidates containing a slash by -X '*/*'. [1] #1553 [2] #1639 (comment)
1 parent fa45b5a commit 5557fbe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ _comp_compgen_sysv_services()
22152215
local sysvdirs
22162216
_comp_sysvdirs &&
22172217
_comp_compgen -U sysvdirs -C "${sysvdirs[0]}" -- \
2218-
-fX "@($_comp_backup_glob|functions|*.sh|README*)"
2218+
-fX "@($_comp_backup_glob|functions|*.sh|README*|*/*)"
22192219
}
22202220

22212221
# This function completes on services

0 commit comments

Comments
 (0)