mirror of
https://github.com/octoleo/hosts.git
synced 2025-02-06 12:28:26 +00:00
Use __
prefix for variables in loops.
This commit is contained in:
parent
c11f22e558
commit
42a2a9f3d4
20
hosts
20
hosts
@ -863,16 +863,16 @@ completions() {
|
||||
_exit_1 printf "Source Git repository not configured.\\n"
|
||||
fi
|
||||
|
||||
for _shell in bash zsh
|
||||
for __shell in bash zsh
|
||||
do
|
||||
local _completion_source="${_my_dir}/etc/${_ME}-completion.${_shell}"
|
||||
local _completion_source="${_my_dir}/etc/${_ME}-completion.${__shell}"
|
||||
|
||||
if ((_download))
|
||||
then
|
||||
if [[ ! -f "${_completion_source}" ]]
|
||||
then
|
||||
_completion_source="$(mktemp)"
|
||||
local _completion_url="${_REPO_RAW_URL}/etc/${_ME}-completion.${_shell}"
|
||||
local _completion_url="${_REPO_RAW_URL}/etc/${_ME}-completion.${__shell}"
|
||||
|
||||
if ! _download_from "${_completion_url}" "${_completion_source}"
|
||||
then
|
||||
@ -885,22 +885,22 @@ completions() {
|
||||
if [[ ! -f "${_completion_source}" ]]
|
||||
then
|
||||
cat <<HEREDOC
|
||||
Unable to find source ${_shell} completion script. You can try downloading
|
||||
Unable to find source ${__shell} completion script. You can try downloading
|
||||
and installing the latest version with the following command (\`sudo\` might
|
||||
be necessary):
|
||||
${_ME} completions install --download
|
||||
|
||||
More information: ${_shell}
|
||||
More information: ${__shell}
|
||||
https://github.com/${_REPO}/blob/master/etc/README.md
|
||||
HEREDOC
|
||||
else
|
||||
local _completion_path=
|
||||
local _completion_target=
|
||||
if [[ "${_shell}" == "bash" ]]
|
||||
if [[ "${__shell}" == "bash" ]]
|
||||
then
|
||||
_completion_path="$(_get_bash_completion_path)"
|
||||
_completion_target="${_completion_path}/${_BASH_COMP_NAME}"
|
||||
elif [[ "${_shell}" == "zsh" ]]
|
||||
elif [[ "${__shell}" == "zsh" ]]
|
||||
then
|
||||
_completion_path="/usr/local/share/zsh/site-functions"
|
||||
_completion_target="${_completion_path}/${_ZSH_COMP_NAME}"
|
||||
@ -935,13 +935,13 @@ HEREDOC
|
||||
local _completion_path=
|
||||
local _completion_target=
|
||||
|
||||
for _shell in bash zsh
|
||||
for __shell in bash zsh
|
||||
do
|
||||
if [[ "${_shell}" == "bash" ]]
|
||||
if [[ "${__shell}" == "bash" ]]
|
||||
then
|
||||
_completion_path="$(_get_bash_completion_path)"
|
||||
_completion_target="${_completion_path}/${_BASH_COMP_NAME}"
|
||||
elif [[ "${_shell}" == "zsh" ]]
|
||||
elif [[ "${__shell}" == "zsh" ]]
|
||||
then
|
||||
_completion_path="/usr/local/share/zsh/site-functions"
|
||||
_completion_target="${_completion_path}/${_ZSH_COMP_NAME}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user