Commit dfb903b
committed
fix(invoke-rc.d): fix a bug of generating existing words
In the current implementation, we try to filter out the elements of
"${options[@]}" that already appear in "${words[@]}". The strategy is
to generate
a. "${options[@]}" and
b. the intersect of "${words[@]}" and "${options[@]}"
in a single list and to pick up only unique elements. However, the
current implementation does not correctly generate "b. the intersect".
It also contains elements of words that contain any of "${options[@]}"
as a substring. This possibly results in generating some words in the
command line as options.
scop#1564 (comment)
In this patch, we rather implement the filtering using `_compgen -X`.1 parent cc75da2 commit dfb903b
1 file changed
+4
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
| |||
0 commit comments