From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24742 invoked from network); 28 Aug 2009 14:59:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Aug 2009 14:59:18 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 40519 invoked from network); 28 Aug 2009 14:59:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Aug 2009 14:59:01 -0000 Received: (qmail 20836 invoked by alias); 28 Aug 2009 14:58:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27235 Received: (qmail 20813 invoked from network); 28 Aug 2009 14:58:53 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 28 Aug 2009 14:58:53 -0000 Received: from smtp.benizi.com (www5.pairlite.com [64.130.10.15]) by bifrost.dotsrc.org (Postfix) with ESMTP id 8A39B8058B59 for ; Fri, 28 Aug 2009 16:58:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by smtp.benizi.com (Postfix) with ESMTPSA id A37A12B4D2; Fri, 28 Aug 2009 10:59:28 -0400 (EDT) Date: Fri, 28 Aug 2009 10:59:28 -0400 (EDT) From: "Benjamin R. Haskell" To: zsh-workers@sunsite.dk Subject: Re: 'loop' vs 'loop=device' in _mount In-Reply-To: <20090827213731.28833f55@pws-pc> Message-ID: References: <20090827213731.28833f55@pws-pc> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.94.2/9757/Fri Aug 28 15:16:44 2009 on bifrost X-Virus-Status: Clean On Thu, 27 Aug 2009, Peter Stephenson wrote: > On Wed, 26 Aug 2009 18:03:32 -0400 (EDT) > "Benjamin R. Haskell" wrote: > > When using completion for mount options, I often run into the annoyance > > that the 'loop' option prompts for the loopback devide to use. Really, > > though, one needn't specify any device in particular... Says the man-page > > for 'mount': > > > > ''' > > If no explicit loop device is mentioned (but just an option `-o loop' is > > given), then mount will try to find some unused loop device and use that. > > ''' > > > > I'll likely just patch my own completion script to change: > > > > Completion/Unix/Command/_mount, line 325: > > - 'loop[use loopback device]:loopback device:_files' > > + 'loop[use loopback device]' > > > > since I couldn't tell how to incorporate an '-o' option that accepts an > > optional argument. > > It should be just a question of doubling the first colon, as follows > (see the documentation for _values). However, I couldn't get the suffix > (i.e. the "=") added to be removed when I typed ",", i.e. tried to add a > new list option instead of an argument... until it finally occurred to > me after an astonishing amount of looking in completely the wrong place > that I hadn't told it when to remove it (patch to _values---so non-final > optional arguments to values were always a bit inconvenient). Oh, good, I'm not crazy... I tried doubling the colon (seeing it used with '(nocheck)check[...]::checking level:...'), and experienced that problem. > The following should do more or less what you want; the behaviour is > like that after "/" in file names, but the "," will cause the > auto-remove behaviour of the "=", too. Indeed. This does exactly what I want. Thanks, Ben