From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: PATCH: _yum: fix typos in cache-handling code
Date: Thu, 22 Jan 2015 01:49:50 +0900 [thread overview]
Message-ID: <7C32A369-D9F2-4862-B73E-D1595AB5DF2B@kba.biglobe.ne.jp> (raw)
The following patch will fix bugs (or typos) in function
_yum_all_pkgs().
The second hank is to complete package names for
$ yum info all <TAB>
(Q1) the indentation in _yum is in disorder:
spaces; tab(s); or even tab after spaces;
should they be "fixed"?
(Q2) possibly very long, and time consuming, list of
package names is offered by a bare compadd. Should it
be wrapped in _wanted ?
Jun
diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum
index ae63364..a698328 100644
--- a/Completion/Redhat/Command/_yum
+++ b/Completion/Redhat/Command/_yum
@@ -85,15 +85,14 @@ _yum()
fi
}
-# Fills the installed pkg cache
+# Fills the all pkg cache
_yum_all_pkgs()
{
if ( [[ ${+_all_pkgs} -eq 0 ]] || _cache_invalid ALL ) &&
! _retrieve_cache ALL;
then
- local prog="yum -C list all | sed 's/\s.*//' | grep '\.'"
- _all_pkgs=( $(kages $prog 2>/dev/null) )
- _store_cache ALL _all_pkg
+ _all_pkgs=( $(yum -C list all | sed 's/\s.*//' | grep '\.' 2>/dev/null) )
+ _store_cache ALL _all_pkgs
fi
}
@@ -227,8 +226,9 @@ _yum_list_or_info()
else
local subcmd
subcmd="${${listlist[(r)$words[2]:*]%%:*}}"
- # Deal with any aliases
+ # offer packages selected by the subcommand
case $subcmd in
+ all) _yum_all;;
installed) _yum_erase;;
available) _yum_install;;
updates) _yum_update;;
reply other threads:[~2015-01-21 17:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=7C32A369-D9F2-4862-B73E-D1595AB5DF2B@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).