Skip to content

Commit db1d239

Browse files
committed
fix(mdtool): use -f -X '!pat' instead of -G pat
#1297 (comment) The compgen option `-X '!pat'` has a problem that it only generates the filenames in the current directory and that it does not perform the filtering by the "cur" specified to the argument of `compgen`: $ compgen -G '*.md' -- doc/ CHANGELOG.md CONTRIBUTING.md README.md style.md In this patch, we use `-f -X '!pat'`, which does not have those limitations.
1 parent e623bdb commit db1d239

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

completions/mdtool

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ _comp_cmd_mdtool()
2121
#if [[ "$prev" == *: ]]; then
2222
# case $prev in
2323
# @(--p:|--project:))
24-
# _comp_compgen -- -G "*.mdp"
24+
# _comp_compgen -- -f -X '!*.mdp'
2525
# ;;
2626
# @(--f:|--buildfile:))
27-
# _comp_compgen -- -G "*.md[ps]"
27+
# _comp_compgen -- -f -X '!*.md[ps]'
2828
# ;;
2929
# esac
3030
#fi
3131
return
3232
;;
3333
"generate-makefiles")
3434
compopt -o filenames
35-
_comp_compgen -- -o filenames -G"*.mds"
35+
_comp_compgen -- -o filenames -f -X '!*.mds'
3636
if [[ $prev == *mds ]]; then
3737
_comp_compgen -- -W '--simple-makefiles --s --d:'
3838
fi

0 commit comments

Comments
 (0)