style: replace double quotes with single quotes in functions help_() and

print_shell_function().

-> Maintainers prefer single quotes instead of double quotes, since it
allows us to look away from tracking what to escape.
This commit is contained in:
Christian Fredrik Johnsen 2024-12-21 07:53:41 +01:00
parent 63bd18d6d7
commit e8f9c3d6a0

View File

@ -159,7 +159,7 @@ function help_() {
echo echo
echo 'export PYENV_ROOT="$HOME/.pyenv"' echo 'export PYENV_ROOT="$HOME/.pyenv"'
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"'
echo "eval \"\$(pyenv init - $shell)\"" echo 'eval "$(pyenv init -'$shell')"'
;; ;;
esac esac
echo echo
@ -253,40 +253,40 @@ function print_shell_function() {
commands=(`pyenv-commands --sh`) commands=(`pyenv-commands --sh`)
case "$shell" in case "$shell" in
fish ) fish )
echo "function pyenv echo 'function pyenv
set command \$argv[1] set command $argv[1]
set -e argv[1] set -e argv[1]
switch \"\$command\" switch "$command"
case ${commands[*]} case '"${commands[*]}"'
source (pyenv \"sh-\$command\" \$argv|psub) source (pyenv "sh-$command" $argv|psub)
case '*' case "*"
command pyenv \"\$command\" \$argv command pyenv "$command" $argv
end end
end" end'
;; ;;
ksh | ksh93 | mksh ) ksh | ksh93 | mksh )
echo "function pyenv { echo 'function pyenv {
typeset command=\$1" typeset command=$1'
;; ;;
* ) * )
echo "pyenv() { echo 'pyenv() {
local command=\$1" local command=$1'
;; ;;
esac esac
if [ "$shell" != "fish" ]; then if [ "$shell" != "fish" ]; then
IFS="|" IFS="|"
echo " [ \"\$#\" -gt 0 ] && shift echo ' [ "$#" -gt 0 ] && shift
case \"\$command\" in case "$command" in
${commands[*]:-/}) '"${commands[*]:-/}"')
eval \"\$(pyenv \"sh-\$command\" \"\$@\")\" eval "$(pyenv "sh-$command" "$@")"
;; ;;
*) *)
command pyenv \"\$command\" \"\$@\" command pyenv "$command" "$@"
;; ;;
esac esac
}" }'
fi fi
} }