aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gentoo.org>2014-11-30 23:39:35 -0800
committerTim Harder <radhermit@gentoo.org>2014-11-30 23:48:36 -0800
commitbde2bd3191812eddac0fab246d85bbb3e75e2a2c (patch)
tree1fdcc59f78d9b21df8cb0657e34a36ecaa50d5c1
parent_gentoo_packages: remove unnecessary semicolons (diff)
downloadzsh-completion-bde2bd3191812eddac0fab246d85bbb3e75e2a2c.tar.gz
zsh-completion-bde2bd3191812eddac0fab246d85bbb3e75e2a2c.tar.bz2
zsh-completion-bde2bd3191812eddac0fab246d85bbb3e75e2a2c.zip
_gentoo_packages: more stylistic consistency
Generally we keep lvalues and rvalues in consistent positions in conditional checks even though they can be swapped around there.
-rw-r--r--src/_gentoo_packages14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/_gentoo_packages b/src/_gentoo_packages
index a8a3aff..2bfa8c4 100644
--- a/src/_gentoo_packages
+++ b/src/_gentoo_packages
@@ -11,7 +11,7 @@ _portdir() {
local mainreponame mainrepopath overlayname overlaypath
if [[ -e /usr/share/portage/config/repos.conf ]]; then
- if [[ ${1} == -o ]]; then
+ if [[ ${1} == "-o" ]]; then
for overlayname in $(_parsereposconf -l); do
overlaypath+=($(_parsereposconf ${overlayname} location))
done
@@ -33,7 +33,7 @@ _portdir() {
source /etc/make.conf 2>/dev/null
source /etc/portage/make.conf 2>/dev/null
- if [[ "-o" == ${1} ]]; then
+ if [[ ${1} == "-o" ]]; then
echo "${(@u)PORTDIR_OVERLAY}"
else
echo "${PORTDIR}"
@@ -76,7 +76,7 @@ _parsereposconf() {
done < ${f}
done
- if [[ "-l" == ${1} ]]; then
+ if [[ ${1} == "-l" ]]; then
echo "${(@)secname}"
else
echo "${v}"
@@ -110,13 +110,13 @@ _parsesetsconf() {
arr[${name}]=${value}
if [[ ${insection} == 1 && ${name} == "section" ]]; then
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
insection=0
elif [[ ${name} == "section" ]]; then
[[ ${value} =~ "${1:t} sets" ]] && insection=1
- [[ "sets" == ${2} ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
+ [[ ${2} == "sets" ]] && [[ ! ${value} =~ "sets" ]] && sections+=(${value})
elif [[ ${insection} == 1 ]]; then
- [[ "sets" == ${2} ]] && continue
+ [[ ${2} == "sets" ]] && continue
if [[ ${name} == "directory" ]]; then
v=${value}
fi
@@ -126,7 +126,7 @@ _parsesetsconf() {
fi
done
- if [[ "sets" == ${2} ]]; then
+ if [[ ${2} == "sets" ]]; then
[[ ((${#sections} > 0)) ]] && echo ${(@)sections}
else
[[ ((${#v} > 0)) ]] && echo ${v:t}