Skip to content

Commit 3a8a2ed

Browse files
committed
fix(gnokii): avoid non-POSIX BRE \|
\| is not supported by POSIX Basic Regular Expressions (BRE). Another way is to use newline to separate the two matches in `grep` pattern, but this is not a commonly-used approach. We instead use `sed` to remove the two matches separately.
1 parent 7bf4ec2 commit 3a8a2ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

completions/gnokii

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ _comp_cmd_gnokii()
222222
fi
223223

224224
local all_cmd="$(_parse_help "$1" "--help all")"
225-
# these 2 below are allowed in combination with others
226-
local main_cmd=$(command grep -v -- '--config\|--phone' <<<"$all_cmd")
227225

226+
# these 2 below are allowed in combination with others
227+
local main_cmd=$(command sed -e '/--config/d;/--phone/d' <<<"$all_cmd")
228228
# don't provide main command completions if one is
229229
# already on the command line
230230
[[ $COMP_LINE =~ $(tr ' ' '\b|' <<<"$main_cmd") ]] && return

0 commit comments

Comments
 (0)