From f30e15159f1506968b00140d4bfb40a812675a11 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 26 Sep 2022 16:59:55 -0700 Subject: [PATCH] finalize shell completions --- completions/jc_bash_completion.sh | 4 ++-- completions/jc_zsh_completion.sh | 4 ++-- jc/shell_completions.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/completions/jc_bash_completion.sh b/completions/jc_bash_completion.sh index 645cf6d8..7c9f1a79 100644 --- a/completions/jc_bash_completion.sh +++ b/completions/jc_bash_completion.sh @@ -67,8 +67,8 @@ _jc() fi done - # if "/proc" (magic for Procfile parsers) is found anywhere in the line, complete with files/directories in the path - if [[ "${words[@]::${#words[@]}-1}" =~ "/proc" ]]; then + # if "/pr[oc]" (magic for Procfile parsers) is in the current word, complete with files/directories in the path + if [[ "${cur}" =~ "/pr" ]]; then _filedir return 0 fi diff --git a/completions/jc_zsh_completion.sh b/completions/jc_zsh_completion.sh index 9c62a92f..f39c5e93 100644 --- a/completions/jc_zsh_completion.sh +++ b/completions/jc_zsh_completion.sh @@ -377,8 +377,8 @@ _jc() { fi done - # if "/proc" (magic for Procfile parsers) is found anywhere in the line, complete with files/directories in the path - if (( ${words:0:-1}[(Ie)/proc] )); then + # if "/pr[oc]" (magic for Procfile parsers) is in the current word, complete with files/directories in the path + if [[ "${words[-1]}" =~ "/pr" ]]; then # run files completion _files return 0 diff --git a/jc/shell_completions.py b/jc/shell_completions.py index a15b74c4..adb5375c 100644 --- a/jc/shell_completions.py +++ b/jc/shell_completions.py @@ -75,8 +75,8 @@ _jc() fi done - # if "/proc" (magic for Procfile parsers) is found anywhere in the line, complete with files/directories in the path - if [[ "$${words[@]::$${#words[@]}-1}" =~ "/proc" ]]; then + # if "/pr[oc]" (magic for Procfile parsers) is in the current word, complete with files/directories in the path + if [[ "$${cur}" =~ "/pr" ]]; then _filedir return 0 fi @@ -196,8 +196,8 @@ _jc() { fi done - # if "/proc" (magic for Procfile parsers) is found anywhere in the line, complete with files/directories in the path - if (( $${words:0:-1}[(Ie)/proc] )); then + # if "/pr[oc]" (magic for Procfile parsers) is in the current word, complete with files/directories in the path + if [[ "$${words[-1]}" =~ "/pr" ]]; then # run files completion _files return 0