zsh-users
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.auc.dk
Subject: Re: Match on range
Date: Fri, 23 Jul 1999 08:53:43 +0200 (MET DST)	[thread overview]
Message-ID: <199907230653.IAA04566@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Bek Oberin's message of Thu, 22 Jul 1999 10:35:57 +1000


Bek Oberin wrote:

> For the completion of playcd, I want to match any number of a range
> created like this:
>    1-`cd-discid /dev/cdrom | cut -f2 -d' '`
> but I can't get compctl to recognize it as a range.  Can it even 
> -do- ranges?

No, it can't.

> Closest I've got is this:
>    compctl -k "(1-`cd-discid /dev/cdrom | cut -f2 -d' '`)" playcd
> but that just matches on an array with one member, being "1-18" or
> whatever.  Not a range.
> 
> Any ideas?

If you don't have braceccl set, the cleanest solution would probably
use a function:

  compctl -K comp_tracks playcd
  comp_tracks() {
    setopt localoptions braceccl
    reply=( {1-$(cd-discid /dev/cdrom | cut -f2 -d' ')} )
  }

If you have braceccl set, something like this should do the job:

  compctl -s '{1-$(cd-discid /dev/cdrom | cut -f2 -d' ')}' playcd



Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-07-23  6:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-23  6:53 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-07-23  8:21 Sven Wischnowsky
1999-07-22  0:35 Bek Oberin

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=199907230653.IAA04566@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-users@sunsite.auc.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).