zsh-workers
 help / color / mirror / code / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Re: [PATCH] modprobe: Complete loaded modules if nothing was found
Date: Mon, 26 Jan 2009 06:29:58 +0300	[thread overview]
Message-ID: <200901260629.59897.arvidjaar@gmail.com> (raw)
In-Reply-To: <1232916306-3355-1-git-send-email-joerg@alea.gnuu.de>

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

On 25 января 2009 23:45:06 Jörg Sommer wrote:
> In some cases it is useful when Zsh does complete the module names
> while they aren't loadable. A module can't be loaded twice, so Zsh
> doesn't suggest modules they are already loaded. But for commands
> like this it is helpful:
>
> % rmmod snd_seq_device; modprobe snd_seq_device

I am afraid this is close to "let's make shell read my mind". This 
is very exotic case and (personally) I prefer to press ENTER after rmmod 
- simply because rmmod may fail and I want to know it.

I'd rather see modules completion synced with current module-init-tools 
:) One obviously missing feature is completing modules from kernel 
different from currently running (modinfo -k) 

> ---
>  Completion/Linux/Command/_modutils |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/Completion/Linux/Command/_modutils
> b/Completion/Linux/Command/_modutils index eefb11f..40399ab 100644
> --- a/Completion/Linux/Command/_modutils
> +++ b/Completion/Linux/Command/_modutils
> @@ -87,7 +87,14 @@ case "$state" in
>      _tags files modules
>      while _tags; do
>        _requested files expl "module file"  _files -g '*.ko' && ret=0
> -      _requested modules expl module compadd -a modules && ret=0
> +      if _requested modules expl module; then
> +          if compadd -a modules; then
> +              ret=0
> +          else
> +              [[ $state = loadable_modules ]] && \
> +                compadd -a loaded_modules && ret=0
> +          fi
> +      fi
>      done
>    ;;





[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-01-26  3:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25 20:45 Jörg Sommer
2009-01-26  3:29 ` Andrey Borzenkov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-01-11 23:44 Jörg Sommer

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=200901260629.59897.arvidjaar@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /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).