File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,14 @@ Also, please bear the following coding guidelines in mind:
132
132
expansions will be unexpectedly performed, which becomes a vulnerability. In
133
133
the latter case, checks by shellcheck and shfmt will not be performed inside
134
134
` '...' ` . Also, ` _comp_compgen_split ` is ` IFS ` -safe.
135
+
136
+ Avoid using ` _comp_compgen -- -G "pattern" ` to generate completions. The
137
+ result is not filtered by the current word ` cur ` due to the Bash design of
138
+ ` compgen ` . Also, this cannot be used to generate filenames with a specified
139
+ extension because the ` -G ` specification only generates the matching
140
+ filepaths in the current directory. It does not look into subdirectories
141
+ even when ` $cur ` implies the completion in a subdirectory. One can instead
142
+ use ` _comp_compgen -- -f -X '!pattern' ` .
135
143
136
144
- When completing available options, offer only the most descriptive
137
145
ones as completion results if there are multiple options that do the
You can’t perform that action at this time.
0 commit comments