diff --git a/share/bash-function.txt b/share/bash-function.txt index 0bbb414..8b857c5 100644 --- a/share/bash-function.txt +++ b/share/bash-function.txt @@ -21,11 +21,11 @@ fi wttr() { local location="${1// /+}" test "$#" -gt 0 && shift - local args="" + local args=() for p in $WTTR_PARAMS "$@"; do - args+=" --data-urlencode $p " + args+=("--data-urlencode" "$p") done - curl -fGsS -H "Accept-Language: ${LANG%_*}" $args --compressed "wttr.in/${location}" + curl -fGsS -H "Accept-Language: ${LANG%_*}" "${args[@]}" --compressed "wttr.in/${location}" } wttr "$@"