mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
Fix detecting completions support on OpenBSD
The non-extended regex pattern didn't work on OpenBSD so this switches grep to extended pattern mode that seems to work consistenty on all systems.
This commit is contained in:
parent
1e1c9cb0dc
commit
eda535a942
2 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ if [ -z "$COMMAND" ]; then
|
|||
fi
|
||||
|
||||
COMMAND_PATH="$(command -v "rbenv-$COMMAND" || command -v "rbenv-sh-$COMMAND")"
|
||||
if grep -i "^\([#%]\|--\|//\) provide rbenv completions" "$COMMAND_PATH" >/dev/null; then
|
||||
if grep -iE "^([#%]|--|//) provide rbenv completions" "$COMMAND_PATH" >/dev/null; then
|
||||
shift
|
||||
exec "$COMMAND_PATH" --complete "$@"
|
||||
fi
|
||||
|
|
|
@ -18,7 +18,7 @@ create_command() {
|
|||
|
||||
@test "command with completion support" {
|
||||
create_command "rbenv-hello" "#!$BASH
|
||||
# provide rbenv completions
|
||||
# Provide rbenv completions
|
||||
if [[ \$1 = --complete ]]; then
|
||||
echo hello
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue