zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: 3.1.5-pws-10: _tar
@ 1999-03-04 15:52 Sven Wischnowsky
  1999-03-04 16:29 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 1999-03-04 15:52 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> Here's an enhancement to the completion for tar; a lot of it is just
> comment, which doesn't clog your shell.  Its main feature is that
> completing files for extraction is now pretty close to ordinary file
> handling.

Hrmpf. `tar zxf zsh-3.1.5-pws-10.tar.gz z/s/z/z_tr<TAB>' didn't work
which is unacceptable for me. Also, completion of filenames with
metacharacters and white spaces didn't work.

The things below adds a helper function `_multi_parts' that gets two
arguments: a separator character and an array (name or `(...)'). It
will then complete the parts of the words that are separated by the
separator character.

It also changes the `_tar' function to use `_multi_parts', maybe Peter
would like to put the changed one into `_tar2' so that users can
decide which one they want.

There is also a bit of fixing in `_path_files' (four double quotes).

Bye
 Sven

diff -u -r oc/Core/_multi_parts Completion/Core/_multi_parts
--- oc/Core/_multi_parts	Thu Mar  4 16:42:54 1999
+++ Completion/Core/_multi_parts	Thu Mar  4 16:42:38 1999
@@ -0,0 +1,173 @@
+#autoload
+
+# This gets two arguments, a separator (which should be only one
+# character) and an array. As usual, the array may be given by it's
+# name or literal as in `(foo bar baz)' (words separated by spaces in
+# parentheses).
+# The parts of words from the array that are separated by the
+# separator character are then completed independently.
+
+local sep matches patstr orig matchflags pref i tmp1 tmp2 gsep nm
+
+_match_test _multi_parts || return 1
+
+# Save the current number of matches to be able to return if we added
+# matches or not.
+
+nm=$compstate[nmatches]
+
+# Get the arguments, first the separator, then the array. The array is 
+# stored in `matches'. Further on this array will always contain those 
+# words from the original array that still match everything we have
+# tried to match while we walk through the string from the line.
+
+sep="$1"
+if [[ "${2[1]}" = '(' ]]; then
+  matches=( ${2[2,-2]} )
+else
+  matches=( "${(@P)2}" )
+fi
+
+# Since we will do some matching and this is not globbing, a `/' will
+# not be treated specially in the matching. So we will have to replace 
+# `*'s we get by expressions of the form `[^<sep>]', where `<sep>' is
+# our separator. We will do this using modifiers of the form
+# `:gs/.../.../'. But if the separator is a slash, this will not work, 
+# so we need to get a character to separate the parts of the `:gs'
+# that is different than the separator character we got. This
+# character is stored in `gsep'.
+
+if [[ "$sep" = / ]]; then
+  gsep=.
+else
+  gsep=/
+fi
+
+# Now build the pattern from what we have on the line. We also save
+# the original string in `orig'. The `eval' is used to replace our
+# separator character by `*<sep>'.
+
+patstr="${PREFIX:q}*${SUFFIX:q}*"
+orig="${PREFIX:q}${SUFFIX:q}"
+
+matchflags=""
+_match_pattern _path_files patstr matchflags
+[[ -n "$_comp_correct" ]] && matchflags="$matchflags(#a$_comp_correct)"
+
+eval patstr\="\$patstr:gs-${sep}-\*${sep}-:gs/\*\*/\*/"
+
+# First we will skip over those parts of the matches for which we have 
+# exact substrings on the line. In `pref' we will build the
+# unambiguous prefix string.
+
+pref=''
+while [[ "$orig" = *${sep}* ]] do
+
+  # First build the pattern to use, then collect all strings from
+  # `matches' that match the prefix we have and the exact substring in 
+  # the array `tmp1'.
+
+  eval "pat=\"\${\${patstr#*\${sep}}:gs${gsep}*${gsep}[^${sep}]#${gsep}}\""
+  tmp1=( "${(@M)matches:#${~matchflags}${orig%%${sep}*}${sep}${~pat}}" )
+
+  # If there are no words matching the exact substring, stop.
+
+  (( $#tmp1 )) || break
+
+  # Otherwise add the part to the prefix, remove it from the matches
+  # (which will also remove all words not matching the string at all), 
+  # and set `patstr' and `orig' to the next component.
+
+  pref="$pref${orig%%${sep}*}${sep}"
+  matches=( "${(@)${(@)matches#${orig%%${sep}*}${sep}}:#}" )
+  orig="${orig#*${sep}}"
+  patstr="${patstr#*${sep}}"
+done
+
+# Now we get all the words that still match in `tmp1'.
+
+eval "pat=\"\$patstr:gs${gsep}*${gsep}[^${sep}]#${gsep}\""
+tmp1=( "${(@M)matches:#${~matchflags}${~pat}}" )
+
+if (( $#tmp1 )); then
+
+  # There are words that are matched, put them int `matches' and then
+  # move all unambiguous components from the beginning into `pref'.
+
+  matches=( "$tmp1[@]" )
+  while [[ "$matches[1]" = *${sep}* ]]; do
+
+    # We just take the first component of the first match and see if
+    # there are other matches with a different prefix (these are
+    # collected in `tmp2'). If there are any, we give up.
+
+    tmp1="${matches[1]%%${sep}*}${sep}"
+    tmp2=( "${(@)matches:#${tmp1}*}" )
+    (( $#tmp2 )) && break
+
+    # All matches have the same prefix, but it into `pref' and remove
+    # it from the matches.
+
+    pref="$pref$tmp1"
+    matches=( "${(@)${(@)matches#$tmp1}:#}" )
+  done
+
+  # Now we can tell the completion code about the things we
+  # found. Strings that have a separator will be added with a suffix.
+
+  for i in "$matches[@]" ; do
+    if [[ "$i" = *${sep}* ]]; then
+      compadd -U -i "$IPREFIX" -p "$pref" -s "${sep}${i#*${sep}}" - "${i%%${sep}*}"
+    else
+      compadd -U -i "$IPREFIX" -p "$pref" - "$i"
+    fi
+  done
+
+elif [[ "$patstr" = */* ]]; then
+
+  # We had no words matching the string from the line. But we want to
+  # be friendly and at least expand the prefix as far as we can. So we 
+  # will loop through the rest of the string from the line and test
+  # the components one by one.
+
+  while [[ "$patstr" = *${sep}* ]]; do
+
+    # First we get all words matching at least this component in
+    # `tmp1'. If there are none, we give up.
+
+    tmp1=( "${(@M)matches:#${~matchflags}${~patstr%%${sep}*}${sep}*}" )
+    (( $#tmp1 )) || break
+
+    # Then we check if there are words that have a different prefix.
+
+    tmp2=( "${(@)tmp1:#${tmp1[1]%%${sep}*}${sep}*}" )
+    if (( $#tmp2 )); then
+
+      # There are words with another prefix, so we have found an
+      # ambiguous component. So we just give all possible prefixes to
+      # the completion code together with our prefix and the rest of
+      # the string from the line as the suffix.
+
+      compadd -U -S '' -i "$IPREFIX" -p "$pref" \
+              -s "${sep}${orig#*${sep}}" - "${(@)matches%%${sep}*}"
+      return 0
+    fi
+
+    # All words have the same prefix, so add it to `pref' again and
+    # try the next component.
+
+    pref="$pref${tmp1[1]%%${sep}*}${sep}"
+    matches=( "${(@)matches#${tmp1[1]%%${sep}*}${sep}}" )
+    orig="${orig#*${sep}}"
+    patstr="${patstr#*${sep}}"
+  done
+
+  # Finally, add the unambiguous prefix and the rest of the string
+  # from the line.
+
+  compadd -U -S '' -i "$IPREFIX" -p "$pref" - "$orig"
+fi
+
+# This sets the return value to indicate that we added matches (or not).
+
+[[ nm -ne compstate[nmatches] ]]
diff -u -r oc/Core/_path_files Completion/Core/_path_files
--- oc/Core/_path_files	Wed Mar  3 17:21:55 1999
+++ Completion/Core/_path_files	Thu Mar  4 14:53:01 1999
@@ -245,7 +245,7 @@
       # the suffixes we just built are used to produce possible matches
       # via globbing.
 
-      for i in $tmp1; do
+      for i in "$tmp1[@]" ; do
         tmp2=( ${~i}/${~matchflags}${~suffixes} )
         [[ $#tmp2 -ne 0 ]] && collect=( $collect $i )
       done
@@ -329,6 +329,6 @@
   else
     compadd -U "$addpfx[@]" "$addsfx[@]" "$group[@]" "$expl[@]" \
             -i "$IPREFIX" -p "$linepath$testpath" -f "$ignore[@]" \
-	    -W "$prepath$realpath$testpath" - ${(@)tmp2#$tmp1}
+	    -W "$prepath$realpath$testpath" - "${(@)tmp2#$tmp1}"
   fi
 done
diff -u -r oc/User/_tar Completion/User/_tar
--- oc/User/_tar	Tue Mar  2 12:37:56 1999
+++ Completion/User/_tar	Thu Mar  4 14:55:17 1999
@@ -52,39 +52,14 @@
   # on the file, keeping the list of filenames cached, plus the
   # name of the tarfile so we know if it changes.
   local largs=-tf
+
   [[ $words[2] = *z* ]] && largs=-tzf
   [[ $words[2] = *Z* ]] && largs=-tZf
   if [[ $tf != $tar_cache_name ]]; then
-    tar_cache_list=($($words[1] $largs $tf))
+    tar_cache_list=("${(@f)$($words[1] $largs $tf)}")
     tar_cache_name=$tf
   fi
- 
-  local pref matched matchdir
-  # Now generate the matches.  First, treat a directory prefix
-  # separately, just like for real files.
-  [[ $PREFIX = */* ]] && pref="${PREFIX%/*}/"
-  if [[ $SUFFIX != */* ]]; then
-    # From inner to outer:
-    # Filter out anything which does not match what's on the line,
-    # remembering no / should come between $PREFIX and $SUFFIX;
-    # remove $pref from the remainder;
-    # filter out anything with extra directories beyond what we need.
-    matched=(
-    ${${${tar_cache_list##^${~PREFIX}[^/]#${~SUFFIX}*}#$pref}##*/*?}
-    )
-    # We need to separate matches with a slash at the end, where
-    # something else could be completed.  Instead of making the slash
-    # a suffix, since that wouldn't appear in the listing, we leave
-    # it but add matches with an empty suffix.
-    matchdir=(${matched##^*/})
-    (( $#matchdir )) && compadd -p "$pref" -S '' $matchdir
-    matched=(${matched##*/})
-    (( $#matched )) && compadd -p "$pref" $matched
-  else
-    # Completing in the middle:  don't trim trailing suffixes.
-    matched=(${tar_cache_list##^${~PREFIX}*${~SUFFIX}#$pref})
-    (( $#matched )) && compadd -p "$pref" $matched
-  fi
+  _multi_parts / tar_cache_list
 elif [[ "$tcmd" = *c*f* && $CURRENT -ge 4 ]] then
   _files
 elif [[ "$tcmd" = *[zZ]*f* && $CURRENT -eq 3 ]] then
--- oc/README	Mon Mar  1 14:19:38 1999
+++ Completion/README	Thu Mar  4 16:49:42 1999
@@ -29,6 +29,9 @@
   _comp_parts
     Utility used for completing words with multiple separate parts, such as
     `<user>@<host>'
+  _multi_parts
+    Utility for completion parts of words given a separator character and 
+    a list of words.
   _compalso
     Utility for calling a function to add additional completions to an
     already existing set.

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


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

* Re: PATCH: 3.1.5-pws-10: _tar
  1999-03-04 15:52 PATCH: 3.1.5-pws-10: _tar Sven Wischnowsky
@ 1999-03-04 16:29 ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1999-03-04 16:29 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:
> The things below adds a helper function `_multi_parts' that gets two
> arguments: a separator character and an array (name or `(...)'). It
> will then complete the parts of the words that are separated by the
> separator character.
> 
> It also changes the `_tar' function to use `_multi_parts', maybe Peter
> would like to put the changed one into `_tar2' so that users can
> decide which one they want.

This isn't working for directories for me.  After zsh-3.1.5-pws-10/ it will
complete files, but not Src.  Typing Src/ makes it complete files but not
directories down there, and so on.  Trying to do a lot in one go leaves a
space where Src should have been, and makes no change after that.

In fact, now it's stopped working altogether: zsh-<TAB> does nothing in
that position.  It's calling _multi_parts, and the list of files is right,
but nothing's coming back.  When I type zsh-3.1.5-pws-10/, I can see it
generate a list of completions with that removed, then I get this

+ orig= 
+ patstr=* 
+ [[  == */* ]]
+ eval pat="$patstr:gs.*.[^/]#."
+ pat=[^/]# 
+ tmp1=( ) 
+ ((  0  ))
+ [[ * == */* ]]
+ [[ nm -ne compstate[nmatches] ]]

and that's all I get. For trying to complete zsh-<TAB>, I get this

+ [[ / == / ]]
+ gsep=. 
+ patstr=zsh-** 
+ orig=zsh- 
+ matchflags= 
+ _match_pattern _path_files patstr matchflags
+ eval matchflags='(#l)'
+ matchflags=(#l) 
+ [[ 2 -eq 2 ]]
+ eval patstr='zsh*-**'
+ patstr=zsh*-** 
+ [[ -n  ]]
+ eval patstr=$patstr:gs-/-\*/-:gs/\*\*/\*/
+ patstr=zsh*-* 
+ pref= 
+ [[ zsh- == */* ]]
+ eval pat="$patstr:gs.*.[^/]#."
+ pat=zsh[^/]#-[^/]# 
+ tmp1=( ) 
+ ((  0  ))
+ [[ zsh*-* == */* ]]
+ [[ nm -ne compstate[nmatches] ]]

and nothing more. Is it mishandling cases with a / at the end?  But what's
happened to the listing I got before of file in zsh-3.1.5-pws-10?  I'm very
confused.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: PATCH: 3.1.5-pws-10: _tar
  1999-03-05  8:18 Sven Wischnowsky
@ 1999-03-05  8:52 ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1999-03-05  8:52 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:
> It was too eager to replace `*s' with `[^/]#'s. The patch below does
> the replacement only for the non-last components.

Working a lot better now, thanks.  It's maybe a little bit eager to stick
in later path components: if I type zsh-3.1.5-pws-10/Sr<TAB> it completes
(with menucompletion) all the way to Src/.cvisignore instead of hanging
around at the next slash.  I suppose normally with ordinary completion
it'll stop after the slash because the rest is ambiguous, but that won't
always be the case.

By the way, I think you can turn things like

eval patstr\="\$patstr:gs-${sep}-\*${sep}-:gs/\*\*/\*/"

into

patstr="${${patstr//$sep/*$sep}//\*##/*}"

which not only avoids the eval, it avoids difficulties with the delimiters
since the $sep is only substituted after the /'s are parsed, plus the
characters in $sep are automatically quoted by the usual noglobsubst rule.
But you have to be careful quoting metacharacters in the `before' text.
You can also now use ## to turn multiple stars into a single one with
extendedglob.  Neither form will turn *** into a single *, since the
replacement text is never used for further matching.  I don't know if
that's a bug, but probably not.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: PATCH: 3.1.5-pws-10: _tar
@ 1999-03-05  8:18 Sven Wischnowsky
  1999-03-05  8:52 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 1999-03-05  8:18 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> Sven Wischnowsky wrote:
> > The things below adds a helper function `_multi_parts' that gets two
> > arguments: a separator character and an array (name or `(...)'). It
> > will then complete the parts of the words that are separated by the
> > separator character.
> > 
> > It also changes the `_tar' function to use `_multi_parts', maybe Peter
> > would like to put the changed one into `_tar2' so that users can
> > decide which one they want.
> 
> This isn't working for directories for me.  After zsh-3.1.5-pws-10/ it will
> complete files, but not Src.  Typing Src/ makes it complete files but not
> directories down there, and so on.  Trying to do a lot in one go leaves a
> space where Src should have been, and makes no change after that.
> 
> In fact, now it's stopped working altogether: zsh-<TAB> does nothing in
> that position.  It's calling _multi_parts, and the list of files is right,
> but nothing's coming back.  When I type zsh-3.1.5-pws-10/, I can see it
> generate a list of completions with that removed, then I get this

It was too eager to replace `*s' with `[^/]#'s. The patch below does
the replacement only for the non-last components.

Bye
 Sven

diff -u oc/Core/_multi_parts Completion/Core/_multi_parts
--- oc/Core/_multi_parts	Thu Mar  4 16:53:13 1999
+++ Completion/Core/_multi_parts	Fri Mar  5 09:18:56 1999
@@ -67,7 +67,8 @@
   # `matches' that match the prefix we have and the exact substring in 
   # the array `tmp1'.
 
-  eval "pat=\"\${\${patstr#*\${sep}}:gs${gsep}*${gsep}[^${sep}]#${gsep}}\""
+  tmp1="${${patstr#*${sep}}%${sep}*}"
+  eval "pat=\"\${tmp1:gs${gsep}*${gsep}[^${sep}]#${gsep}}${patstr##*${sep}}\""
   tmp1=( "${(@M)matches:#${~matchflags}${orig%%${sep}*}${sep}${~pat}}" )
 
   # If there are no words matching the exact substring, stop.
@@ -86,7 +87,12 @@
 
 # Now we get all the words that still match in `tmp1'.
 
-eval "pat=\"\$patstr:gs${gsep}*${gsep}[^${sep}]#${gsep}\""
+if [[ "$patstr" = *${sep}* ]]; then
+  tmp1="${patstr%${sep}*}${sep}"
+  eval "pat=\"\$tmp1:gs${gsep}*${gsep}[^${sep}]#${gsep}${patstr##*${sep}}\""
+else
+  pat="$patstr"
+fi
 tmp1=( "${(@M)matches:#${~matchflags}${~pat}}" )
 
 if (( $#tmp1 )); then
@@ -123,7 +129,7 @@
     fi
   done
 
-elif [[ "$patstr" = */* ]]; then
+elif [[ "$patstr" = *${sep}* ]]; then
 
   # We had no words matching the string from the line. But we want to
   # be friendly and at least expand the prefix as far as we can. So we 

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


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

* PATCH: 3.1.5-pws-10: _tar
@ 1999-03-02 10:35 Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1999-03-02 10:35 UTC (permalink / raw)
  To: Zsh hackers list

Here's an enhancement to the completion for tar; a lot of it is just
comment, which doesn't clog your shell.  Its main feature is that
completing files for extraction is now pretty close to ordinary file
handling.  It also handles GNU long arguments, but this is a little erratic
in combination with other arguments, since it always assumes the basic
commands are in second position and the archive name in third.  This could
do with some more work.

--- Completion/User/_tar.bk	Mon Mar  1 13:50:36 1999
+++ Completion/User/_tar	Tue Mar  2 11:30:16 1999
@@ -1,11 +1,94 @@
 #defcomp tar
 
-local fl="$words[2]" tf="$words[3]"
+# Tar completion.  Features:
+#  - Assumes tar commands are in second position, tar archive is in third
+#    e.g. tar xvzf zsh-3.0.5.tar.gz ...
+#    Could search better.  Send me the patch.
+#  - `tar' can be called anything, will use the correct name
+#  - Preferentially completes *.tar and *.TAR files in third position
+#  - unless z or Z appears in the commands, in which case prefer *.tar.gz
+#    and similar (GNU tar).
+#  - From fourth position on, if command is x or t, completes files inside
+#    archive.  This is supposed to look pretty much as if the files are
+#    in an ordinary directory hierarchy.  Handles extraction from compressed
+#    archives (GNU tar).
+#  - Anywhere -- appears, gets a list of long options to complete from
+#    tar itself (GNU tar); this needs perl.  If you have GNU tar but not
+#    perl:  your system manager is weird.
+#  - Things like --directory=... are also completed correctly.
 
-if [[ ( "$fl" = *t*f* || "$fl" = *x*f* ) && -position 4 100000 ]]; then
-  compgen -k "( $(tar tf $tf) )"
-elif [[ "$fl" = *c*f* && -position 4 100000 ]]; then
+emulate -LR zsh
+setopt extendedglob
+
+local nm=$NMATCHES tcmd="$words[2]" tf="$words[3]"
+
+if [[ $PREFIX = *=* ]]; then
+  # For GNU tar arguments like --directory=
+  IPREFIX=${PREFIX%%\=*}=
+  PREFIX=${PREFIX#*=}
+  if [[ $IPREFIX = --directory* ]]; then
+    _path_files -/
+  else
+    _files
+  fi
+elif [[ $PREFIX = --* ]]; then
+  # gnu tar, generate completions from --help
+  # ones followed by = get that as a suffix
+  local -a ownlist eqlist
+  local comp
+  $words[1] --help |
+  perl -ne 'while (/--[^[\s,='\'']+=?/g) { print "$&\n"; }' |
+  while read comp; do
+    if [[ $comp = *= ]]; then
+      eqlist[$#eqlist+1]=${comp%=}
+    else
+      ownlist[$#ownlist+1]=$comp
+    fi
+  done
+  compgen -S '=' -k eqlist
+  compgen -k ownlist
+elif [[ "$tcmd" = *[tx]*f* && $CURRENT -ge 4 ]] then
+  # Listing or extracting a particular file.  We run `tar t...'
+  # on the file, keeping the list of filenames cached, plus the
+  # name of the tarfile so we know if it changes.
+  local largs=-tf
+  [[ $words[2] = *z* ]] && largs=-tzf
+  [[ $words[2] = *Z* ]] && largs=-tZf
+  if [[ $tf != $tar_cache_name ]]; then
+    tar_cache_list=($($words[1] $largs $tf))
+    tar_cache_name=$tf
+  fi
+ 
+  local pref matched matchdir
+  # Now generate the matches.  First, treat a directory prefix
+  # separately, just like for real files.
+  [[ $PREFIX = */* ]] && pref="${PREFIX%/*}/"
+  if [[ $SUFFIX != */* ]]; then
+    # From inner to outer:
+    # Filter out anything which does not match what's on the line,
+    # remembering no / should come between $PREFIX and $SUFFIX;
+    # remove $pref from the remainder;
+    # filter out anything with extra directories beyond what we need.
+    matched=(
+    ${${${tar_cache_list##^${~PREFIX}[^/]#${~SUFFIX}*}#$pref}##*/*?}
+    )
+    # We need to separate matches with a slash at the end, where
+    # something else could be completed.  Instead of making the slash
+    # a suffix, since that wouldn't appear in the listing, we leave
+    # it but add matches with an empty suffix.
+    matchdir=(${matched##^*/})
+    (( $#matchdir )) && compadd -p "$pref" -S '' $matchdir
+    matched=(${matched##*/})
+    (( $#matched )) && compadd -p "$pref" $matched
+  else
+    # Completing in the middle:  don't trim trailing suffixes.
+    matched=(${tar_cache_list##^${~PREFIX}*${~SUFFIX}#$pref})
+    (( $#matched )) && compadd -p "$pref" $matched
+  fi
+elif [[ "$tcmd" = *c*f* && $CURRENT -ge 4 ]] then
   _files
-elif [[ "$words[CURRENT-1]" = *f* && CURRENT -eq 3 ]]; then
+elif [[ "$tcmd" = *[zZ]*f* && $CURRENT -eq 3 ]] then
+  _files -g '*.((tar|TAR).(gz|Z)|.tgz)'
+elif [[ "$tcmd" = *f* && $CURRENT -eq 3 ]] then
   _files -g '*.(tar|TAR)'
 fi

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

end of thread, other threads:[~1999-03-05  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-04 15:52 PATCH: 3.1.5-pws-10: _tar Sven Wischnowsky
1999-03-04 16:29 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
1999-03-05  8:18 Sven Wischnowsky
1999-03-05  8:52 ` Peter Stephenson
1999-03-02 10:35 Peter Stephenson

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