Skip to content

Commit 81cfa1f

Browse files
committed
fix(mdtool): fix usage of compgen -G
The original code (which is commented out and marked as TODO) tried to perform the filename generation by specifying both `-f` and `-G`, and also specifying `-G` multiple times. This has the following issues: * The completion specification of `-f` and `-G` are independent, so this code is going to generate all filenames with `-f`. Then, it additionally generates the filenames matching the specified pattern. * The `-G pat` can only be specified once, or the latter `-G pat` specification will overwrite the previous specification. We should combine multiple patterns into one. Note: This code stub was originally introduced in commit 73225ea. In this patch, we remove `-f` and merge multiple `-G`.
1 parent fb0e475 commit 81cfa1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

completions/mdtool

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ _comp_cmd_mdtool()
2121
#if [[ "$prev" == *: ]]; then
2222
# case $prev in
2323
# @(--p:|--project:))
24-
# _comp_compgen -- -f -G "*.mdp"
24+
# _comp_compgen -- -G "*.mdp"
2525
# ;;
2626
# @(--f:|--buildfile:))
27-
# _comp_compgen -- -f -G "*.mdp" -G "*.mds"
27+
# _comp_compgen -- -G "*.md[ps]"
2828
# ;;
2929
# esac
3030
#fi

0 commit comments

Comments
 (0)