public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Tim Harder" <radhermit@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/zsh-completion:master commit in: src/
Date: Sat, 20 Dec 2014 02:35:58 +0000 (UTC)	[thread overview]
Message-ID: <1419042772.52d16f8a397b247a1e2e662827507b7f86d77fc6.radhermit@gentoo> (raw)

commit:     52d16f8a397b247a1e2e662827507b7f86d77fc6
Author:     Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 20 02:20:38 2014 +0000
Commit:     Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Sat Dec 20 02:32:52 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=52d16f8a

array formatting, whitespace consistency, and other minor cleanups

---
 src/_genlop     | 85 ++++++++++++++++++++++++++++-----------------------------
 src/_gentoolkit |  9 ++++--
 src/_portage    | 36 ++++++++++++++----------
 3 files changed, 68 insertions(+), 62 deletions(-)

diff --git a/src/_genlop b/src/_genlop
index 92c844b..420c8c5 100644
--- a/src/_genlop
+++ b/src/_genlop
@@ -3,73 +3,70 @@
 #genlop 0.30.8
 
 _genlop () {
-local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
-days=(monday tuesday wednesday thursday friday saturday sunday)
-months=(january february march april may june july august september october november december)
-arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
-single=( --current -c --pretend -p --help -h --version -v )
+  local prev1="$words[CURRENT-1]" prev2="$words[CURRENT-2]" days months arg single state lstate
+  days=(monday tuesday wednesday thursday friday saturday sunday)
+  months=(january february march april may june july august september october november december)
+  arg=( --current -c --time -t --gmt -g --info -i --file -f --rsync -r --unmerge -u --date --search -s --list -l )
+  single=( --current -c --pretend -p --help -h --version -v )
 
   [[ ${prev2} == (1st|2nd|3rd|4th|5th) ]] &&
-    compadd in\ $months && return 0
+    compadd $months && return 0
   [[ ${prev1} == ([2-9]|[1-9][0-9]*) && ${prev2} != \
-  (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+    (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
     _values '' 'days ago' 'months ago' 'years ago' 'weeks ago' && return 0
   [[ ${prev1} == (1) && ${prev2} != \
-  (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
+    (january|february|march|april|may|june|july|august|september|october|november|december) ]] &&
     _values '' 'day ago' 'month ago' 'year ago' 'week ago' && return 0
 
   case "$prev1" in
     last)
       _values '' month week
-    compadd $days && return 0
-  ;;
+      compadd $days && return 0
+      ;;
     1st|2nd|3rd|4th|5th)
-    compadd $days && return 0
-  ;;
+      compadd $days && return 0
+      ;;
     january|february|march|april|may|june|july|august|september|october|november|december)
-    compadd {1..31} && return 0
-  ;;
+      compadd {1..31} && return 0
+      ;;
     --date)
       _message 'enter number for more options or use mm/dd/yyyy format'
-      _values '' \
-    last yesterday 1st 2nd 3rd 4th 5th
-    _alternative \
-    '*:*:_days' '*:*:_months' && return 0
-  ;;
+      _values '' last yesterday 1st 2nd 3rd 4th 5th
+      _alternative '*:*:_days' '*:*:_months' && return 0
+      ;;
     --file|-f)
       _arguments '*:logfile:_files' && return 0
-  ;;
+      ;;
     *)
-     _arguments \
-    "($single $arg *)"{--current,-c}"[display the current merge in action]" \
-    "($single)*--date[specify date of event]:date:->date" \
-    "($single)*-f[specify the logfile to use]:logfile:_files" \
-    "($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
-    "($single $arg *)"{--help,-h}"[display help information]" \
-    "($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
-    "($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
-    "(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
-    "($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
-    "($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
-    "($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
-    "($single --time -t)"{--time,-t}"[display merge time]" \
-    "($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
-    "($single $arg *)"{--version,-v}"[display version information]" \
-    "($single)*:package:_gentoo_packages available"
-  ;;
+      _arguments \
+        "($single $arg *)"{--current,-c}"[display the current merge in action]" \
+        "($single)*--date[specify date of event]:date:->date" \
+        "($single)*-f[specify the logfile to use]:logfile:_files" \
+        "($single --gmt -g)"{--gmt,-g}"[display time in GMT/UTC format (default is local time)]" \
+        "($single $arg *)"{--help,-h}"[display help information]" \
+        "($single --info -i --list -l)"{--info,-i}"[print brief summary about installed ebuild]" \
+        "($single --search -s --info -i --list -l *)"{--list,-l}"[list merge history]" \
+        "(--nocolor -n)"{--nocolor,-n}"[disable colored output]" \
+        "($single $arg *)"{--pretend,-p}"[estimate build time of a piped emerge -p]" \
+        "($single --search -s --info -i --time -t --unmerge -u --rsync -r *)"{--rsync,-r}"[display rsync history]" \
+        "($single --rsync -r --search -s --list -l *)"{--search,-s}"[select ebuilds matching the provided regular expression]:pattern:" \
+        "($single --time -t)"{--time,-t}"[display merge time]" \
+        "($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
+        "($single $arg *)"{--version,-v}"[display version information]" \
+        "($single)*:package:_gentoo_packages available"
+      ;;
   esac
 
   while [[ -n "$state" ]]; do
     lstate=$state
     state=''
     case "$lstate" in
-    date) _message 'enter number for more options or use mm/dd/yyyy format'
-    _values '' \
-    last yesterday 1st 2nd 3rd 4th 5th
-    _alternative \
-    ':*:_days' ':*:_months' && return 0
-    ;;
-  esac
+      date)
+        _message 'enter number for more options or use mm/dd/yyyy format'
+        _values '' last yesterday 1st 2nd 3rd 4th 5th
+        _alternative ':*:_days' ':*:_months' && return 0
+        ;;
+    esac
   done
 }
 

diff --git a/src/_gentoolkit b/src/_gentoolkit
index 0b0d956..903e4b6 100644
--- a/src/_gentoolkit
+++ b/src/_gentoolkit
@@ -22,6 +22,7 @@ _packages () {
 
 _euse () {
   local state tmp start_args suboptions_args
+
   start_args=(
     {'(--help)-h','(-h)--help'}'[show help]'
     {'(--version)-v','(-v)--version'}'[show version]'
@@ -34,10 +35,12 @@ _euse () {
     {'(--prune)-P','(-P)--prune'}'[alias for --remove]'
     {'(--package)-p','(-p)--package'}'[used with -E, -D, and -R to apply to a specific package only]'
   )
+
   suboptions_args=(
     {'(--global)-g','(-g)--global'}'[show only global use flags]'
     {'(--local)-l','(-l)--local'}'[show only local use flags]'
   )
+
   if (( CURRENT == 2 )); then
     _arguments -s $start_args
   elif (( CURRENT == 3 )); then
@@ -236,10 +239,12 @@ _eclean_wrapper () {
     '(: -)'{-h,--help}'[show help]'
     '(: -)'{-V,--version}'[show version]'
   )
+
   dist_opts=(
     '(-s,--size-limit)'{-s,--size-limit}'[do not delete disfiles bigger than <size>]:size:_eclean_size'
     '(-f,--fetch-restricted)'{-f,--fetch-restricted}'[protect fetch-restricted files]'
   )
+
   # XXX: If you add options here make sure that it'll work.
   #       since there isn't any option *right* now, $pkg_opts
   #       is never used.
@@ -258,11 +263,9 @@ _eclean_wrapper () {
       # global_opts and packages|distfiles otherwhise.
       if (( $words[(I)(packages)] )); then
         # Currently no options so return 0
-        #_values "packages options" $pkg_opts &&
         return 0
       elif (( $words[(I)(distfiles)] )); then
-        _values "distfiles options" $dist_opts &&
-        return 0
+        _values "distfiles options" $dist_opts && return 0
       else
         _arguments -s $global_opts
         # complete packages|distfiles only if CURRENT-1 don't need an arg

diff --git a/src/_portage b/src/_portage
index efa3c0e..7610937 100644
--- a/src/_portage
+++ b/src/_portage
@@ -12,7 +12,6 @@
 # Still TODO:
 # xpak
 
-# Stuff for ebuild
 _ebuild () {
   if (( CURRENT == 2 )); then
     _files -g \*.ebuild
@@ -38,7 +37,6 @@ _ebuild () {
       'manifest[Updates the manifest file for the package.]' \
       'rpm[Builds a RedHat RPM package]'
   fi
-
 }
 
 _quickpkg () {
@@ -65,24 +63,30 @@ _quickpkg () {
   fi
 }
 
-# Stuff for emerge
-
 _emerge () {
-  local nopkg_opts all noask_opts bopts install_args common_args profiles
+  local noask_opts nopkg_opts bopts all common_args install_args profiles
 
-  noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \
-    -S --version -V --help -h --metadata --check-news)
+  noask_opts=(
+    -p -a --pretend --ask --regen --info --search -s --searchdesc
+    -S --version -V --help -h --metadata --check-news
+  )
 
-  nopkg_opts=(--resume --skipfirst -c --clean -h --help --depclean --info \
-    --metadata -P --prune --regen -s --search -S --searchdesc --sync -C \
-    --unmerge -V --version -i --inject --list-sets --deselect --check-news)
+  nopkg_opts=(
+    --resume --skipfirst -c --clean -h --help --depclean --info
+    --metadata -P --prune --regen -s --search -S --searchdesc --sync -C
+    --unmerge -V --version -i --inject --list-sets --deselect --check-news
+  )
 
-  bopts=($nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g \
-    --getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly)
+  bopts=(
+    $nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g
+    --getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly
+  )
 
-  all=($bopts -l --changelog --columns --deep -D --emptytree -e --newuse \
-    --noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t \
-    -u --update -U --upgradeonly --config)
+  all=(
+    $bopts -l --changelog --columns --deep -D --emptytree -e --newuse
+    --noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t
+    -u --update -U --upgradeonly --config
+  )
 
   common_args=(
     "($noask_opts --sync)"{-p,--pretend}"[Simply display what would be done]"
@@ -102,6 +106,7 @@ _emerge () {
     "--moo[Have you mooed today?]"
     "(--jobs)--jobs[Number of packages to build simultaneously]:jobs:({1.."${#${$(</proc/cpuinfo)/^processor}}"})"
   )
+
   install_args=(
     "--deselect[Remove atom from world file]"
     "--alphabetical[Sort use/other flags output alphabetically despite of status]"
@@ -191,6 +196,7 @@ _emerge () {
     "(: $all[3,-1])--skipfirst[Removes the first package in the resume list]"
     "($all)--keep-going[Continue merge even if a package fails to build]"
   )
+
   profiles=(
     'world[All packages in the world profile]'
     'system[All packages in the system profile]'


             reply	other threads:[~2014-12-20  2:36 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-20  2:35 Tim Harder [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-17 14:45 [gentoo-commits] proj/zsh-completion:master commit in: src/ Vadim Misbakh-Soloviov
2022-01-12  9:35 Vadim Misbakh-Soloviov
2022-01-12  9:35 Vadim Misbakh-Soloviov
2020-09-14  3:13 Vadim Misbakh-Soloviov
2020-09-14  3:13 Vadim Misbakh-Soloviov
2020-09-14  3:13 Vadim Misbakh-Soloviov
2020-09-14  3:13 Vadim Misbakh-Soloviov
2020-02-19 18:51 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 18:47 Vadim Misbakh-Soloviov
2020-02-19 17:53 Vadim Misbakh-Soloviov
2020-02-19 17:53 Vadim Misbakh-Soloviov
2020-02-19 17:53 Vadim Misbakh-Soloviov
2015-04-28 14:56 Vadim A. Misbakh-Soloviov
2015-04-28 12:07 Vadim A. Misbakh-Soloviov
2015-04-28 12:07 Vadim A. Misbakh-Soloviov
2014-12-22 22:57 Tim Harder
2014-12-21  9:51 Tim Harder
2014-12-21  9:51 Tim Harder
2014-12-20 23:22 Tim Harder
2014-12-20 22:29 Tim Harder
2014-12-20 20:04 Tim Harder
2014-12-20 20:04 Tim Harder
2014-12-20 20:04 Tim Harder
2014-12-20  5:31 Tim Harder
2014-12-20  4:54 Tim Harder
2014-12-20  4:39 Tim Harder
2014-12-20  4:39 Tim Harder
2014-12-20  3:21 Tim Harder
2014-12-20  3:08 Tim Harder
2014-12-20  3:08 Tim Harder
2014-12-20  3:08 Tim Harder
2014-12-20  2:15 Tim Harder
2014-12-20  2:15 Tim Harder
2014-12-18 16:59 Tim Harder
2014-12-18 16:59 Tim Harder
2014-12-18 16:59 Tim Harder
2014-12-01  7:48 Tim Harder
2014-12-01  7:48 Tim Harder
2014-12-01  7:34 Tim Harder
2014-12-01  7:34 Tim Harder
2014-11-27  7:23 Tim Harder
2014-11-27  7:23 Tim Harder
2014-11-27  6:39 Tim Harder
2014-11-24  9:13 Vadim A. Misbakh-Soloviov
2014-11-24  7:33 Tim Harder
2014-11-24  7:33 Tim Harder
2014-11-23 21:35 Vadim A. Misbakh-Soloviov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419042772.52d16f8a397b247a1e2e662827507b7f86d77fc6.radhermit@gentoo \
    --to=radhermit@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox