fix(shell-completion): strictly parse env output

shell functions may be exported, when env prints their body in multiple
lines
This commit is contained in:
Eisuke Kawashima
2025-07-14 16:48:25 +09:00
parent b371e7252c
commit 86fff7fb38

View File

@@ -43,7 +43,7 @@ __get_machines() {
__get_env() {
local a
env | { while read -r a; do echo " ${a%%=*}"; done; }
env | { while read -r a; do [[ $a =~ ^[A-Za-z0-9_]+= ]] && echo " ${a%%=*}"; done; }
}
__get_interfaces(){