zsh-users
 help / color / mirror / code / Atom feed
* _tar -*Cf*?
@ 2000-11-25  5:43 Calum Selkirk
  2000-11-26  0:06 ` Calum Selkirk
  2000-11-26  2:20 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Calum Selkirk @ 2000-11-25  5:43 UTC (permalink / raw)
  To: zsh-users

hi zshers ..

i'd been having problems using the -C switch with _tar .. i'd usually
use it in the context of:

tar zxvf file.tar.gz -C /path/to/unpack 

however this would call _tar_archive and complete /path on the archives
directory structure. Looking at _tar i see:

elif [[ ( CURRENT -gt 2 && "$words[CURRENT-1]" = -*Cf*) ||
        ( CURRENT -eq 3 && "$words[2]" = *Cf* ) ]]; then

  # a directory for -C
  
     _files -/ 

I'm pretty new to zsh so forgive my ignorance, but shouldn't this be -C
rather than -Cf to get commpletion on the --directory to change to?  

Changing it to -C does indeed produce the completion i'd expected and
_tar_archive seems to work as i'd expect with this change. I guess i'm
looking for a sanity check .. is this a typo/error or is this likely to
break something?

calum


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _tar -*Cf*?
  2000-11-25  5:43 _tar -*Cf*? Calum Selkirk
@ 2000-11-26  0:06 ` Calum Selkirk
  2000-11-26  2:20 ` Bart Schaefer
  1 sibling, 0 replies; 5+ messages in thread
From: Calum Selkirk @ 2000-11-26  0:06 UTC (permalink / raw)
  To: zsh-users

> i'd been having problems using the -C switch with _tar .. i'd usually
> use it in the context of:
> 
> tar zxvf file.tar.gz -C /path/to/unpack 
> 
> however this would call _tar_archive and complete /path on the archives
> directory structure. Looking at _tar i see:
> 
> elif [[ ( CURRENT -gt 2 && "$words[CURRENT-1]" = -*Cf*) ||
>         ( CURRENT -eq 3 && "$words[2]" = *Cf* ) ]]; then
> 
>   # a directory for -C
>   
>      _files -/ 
> 
> I'm pretty new to zsh so forgive my ignorance, but shouldn't this be -C
> rather than -Cf to get commpletion on the --directory to change to?  
> 
> Changing it to -C does indeed produce the completion i'd expected and
> _tar_archive seems to work as i'd expect with this change. I guess i'm
> looking for a sanity check .. is this a typo/error or is this likely to
> break something?
 
sorry .. i'd failed to mention that i'm using 3.1.9-dev-6

> calum
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _tar -*Cf*?
  2000-11-25  5:43 _tar -*Cf*? Calum Selkirk
  2000-11-26  0:06 ` Calum Selkirk
@ 2000-11-26  2:20 ` Bart Schaefer
  2000-11-27  7:03   ` Calum Selkirk
  1 sibling, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2000-11-26  2:20 UTC (permalink / raw)
  To: Calum Selkirk, zsh-users

On Nov 25,  5:43am, Calum Selkirk wrote:
}
} Looking at _tar i see:
} 
} elif [[ ( CURRENT -gt 2 && "$words[CURRENT-1]" = -*Cf*) ||
}         ( CURRENT -eq 3 && "$words[2]" = *Cf* ) ]]; then
} 
} I'm pretty new to zsh so forgive my ignorance, but shouldn't this be -C
} rather than -Cf to get commpletion on the --directory to change to?  

It should probably be *C*f*.  This came from zsh-workers/9094, in which
Clint wrote:
> This should handle -Cf now, but not -fC, which, of course, requires
> the positions of directory and tarfile to be reversed.

There are several other possible combinations that _tar doesn't handle
(including, say, -bf where a blocksize has to precede the file name).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _tar -*Cf*?
  2000-11-26  2:20 ` Bart Schaefer
@ 2000-11-27  7:03   ` Calum Selkirk
  2000-11-27 17:33     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Calum Selkirk @ 2000-11-27  7:03 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer [schaefer@candle.brasslantern.com] wrote:

> On Nov 25,  5:43am, Calum Selkirk wrote:
>
> > Looking at _tar i see:
> > 
> > elif [[ ( CURRENT -gt 2 && "$words[CURRENT-1]" = -*Cf*) ||
> >         ( CURRENT -eq 3 && "$words[2]" = *Cf* ) ]]; then
> > 
> > I'm pretty new to zsh so forgive my ignorance, but shouldn't this be -C
> > rather than -Cf to get commpletion on the --directory to change to?  
> 
> It should probably be *C*f*.  This came from zsh-workers/9094, in which
> Clint wrote:
>
> > This should handle -Cf now, but not -fC, which, of course, requires
> > the positions of directory and tarfile to be reversed.
> 
> There are several other possible combinations that _tar doesn't handle
> (including, say, -bf where a blocksize has to precede the file name).

Thats what i had originally thought .. but *C*f* would also produce the
completion on _tar_archive  and not _file -/ (which would be my expected
behavior from the -C switch). Anyhow thanks for your reply .. as i'd
mentioned in my previous i've only been using zsh for a short while ..
i can't tell you how great i'm finding it .. i'm hooked! kudos to all
involved.

I'm planning writting a basic intro (that would only cover 3.1.9 as that
is all i'm familiar with) would that seem too premature, meaning is it
safe to assume that 4.x (or what ever the next stable release it to be)
is on the horizon?

calum


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: _tar -*Cf*?
  2000-11-27  7:03   ` Calum Selkirk
@ 2000-11-27 17:33     ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-11-27 17:33 UTC (permalink / raw)
  To: Calum Selkirk, zsh-users

On Nov 27,  7:03am, Calum Selkirk wrote:
} Subject: Re: _tar -*Cf*?
}
} Bart Schaefer [schaefer@candle.brasslantern.com] wrote:
} 
} > On Nov 25,  5:43am, Calum Selkirk wrote:
} >
} > > elif [[ ( CURRENT -gt 2 && "$words[CURRENT-1]" = -*Cf*) ||
} > >         ( CURRENT -eq 3 && "$words[2]" = *Cf* ) ]]; then
} > > 
} > > I'm pretty new to zsh so forgive my ignorance, but shouldn't this be -C
} > > rather than -Cf to get commpletion on the --directory to change to?  
} > 
} > It should probably be *C*f*.
} 
} Thats what i had originally thought .. but *C*f* would also produce the
} completion on _tar_archive  and not _file -/ (which would be my expected
} behavior from the -C switch).

How about [^f]#C* instead?  The important thing is that *f*C* should NOT
match.

} I'm planning writting a basic intro (that would only cover 3.1.9 as that
} is all i'm familiar with)

Have you had a look at http://sunsite.dk/zsh/ ?  In particular, look at
http://sunsite.dk/zsh/Guide/zshguide.html by Peter Stephenson <pws@csr.com>.
He might be interested in contributions.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-11-27 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-25  5:43 _tar -*Cf*? Calum Selkirk
2000-11-26  0:06 ` Calum Selkirk
2000-11-26  2:20 ` Bart Schaefer
2000-11-27  7:03   ` Calum Selkirk
2000-11-27 17:33     ` Bart Schaefer

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).