diff --git a/tom/include/tom/commands/stubs/integratestubs.hpp b/tom/include/tom/commands/stubs/integratestubs.hpp index 8737df2d5..82d7767ab 100644 --- a/tom/include/tom/commands/stubs/integratestubs.hpp +++ b/tom/include/tom/commands/stubs/integratestubs.hpp @@ -65,7 +65,7 @@ __tom_connections() { # Nothing found [[ ${#lines[@]} -eq 0 ]] && return - regex='.*"(\w+)".*// shell:connection' + regex='"([[:alnum:]_.-]+)".*// shell:connection$' for line in "${lines[@]}"; do if [[ $line =~ $regex ]]; then @@ -263,8 +263,10 @@ __tom_connections() { # Nothing found [[ $#lines -eq 0 ]] && return + regex='"([[:alnum:]_.-]+)".*// shell:connection$' + for line in $lines; do - if [[ $line =~ '.*"(\w+)".*// shell:connection' ]]; then + if [[ $line =~ $regex ]]; then connections+=$match[1] fi done diff --git a/tools/completions/tom.bash b/tools/completions/tom.bash index 08cf02af7..b87b344b2 100644 --- a/tools/completions/tom.bash +++ b/tools/completions/tom.bash @@ -21,7 +21,7 @@ __tom_connections() { # Nothing found [[ ${#lines[@]} -eq 0 ]] && return - regex='.*"(\w+)".*// shell:connection' + regex='"([[:alnum:]_.-]+)".*// shell:connection$' for line in "${lines[@]}"; do if [[ $line =~ $regex ]]; then diff --git a/tools/completions/tom.zsh b/tools/completions/tom.zsh index c250e516a..5e4756371 100644 --- a/tools/completions/tom.zsh +++ b/tools/completions/tom.zsh @@ -53,8 +53,10 @@ __tom_connections() { # Nothing found [[ $#lines -eq 0 ]] && return + regex='"([[:alnum:]_.-]+)".*// shell:connection$' + for line in $lines; do - if [[ $line =~ '.*"(\w+)".*// shell:connection' ]]; then + if [[ $line =~ $regex ]]; then connections+=$match[1] fi done