about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-12-13 22:05:59 +0000
committerClint Adams <clint@users.sourceforge.net>2007-12-13 22:05:59 +0000
commitc48b70d59e8c9df2c8999ffbdc603052fb609730 (patch)
tree76ae62dc3c491ed2799dcb505619d2811d0d6343
parentb7669a83992b915d9e114f7e208286196fec70f2 (diff)
downloadzsh-c48b70d59e8c9df2c8999ffbdc603052fb609730.tar.gz
zsh-c48b70d59e8c9df2c8999ffbdc603052fb609730.tar.xz
zsh-c48b70d59e8c9df2c8999ffbdc603052fb609730.zip
Peter: 24235: handle underscores
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Base/Utility/_arguments10
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 54a137a60..4c0d1d6af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-13  Clint Adams  <clint@zsh.org>
+
+	* Peter: 24235: Completion/Base/Utility/_arguments: handle
+	underscores.
+
 2007-12-13  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 24241: Doc/Zsh/expn.yo: explain the effect of time glob
diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments
index d1aafd79a..21c1541fb 100644
--- a/Completion/Base/Utility/_arguments
+++ b/Completion/Base/Utility/_arguments
@@ -97,7 +97,7 @@ if (( long )); then
        # present.  Maybe the problem was that the intervening code
        # didn't.  If it's buggy without removing them, the problem
        # probably is later, not here.
-       if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9-]#}]} ]]; then
+       if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9_-]#}]} ]]; then
 	 tmp+=($match[1])
        fi
        opt=$match[2]
@@ -218,9 +218,9 @@ if (( long )); then
 	    odescr=
 	  fi
 	  if [[ $opt = (#b)(*)\[\=* ]]; then
-	    opt2=${${match[1]}//[^a-zA-Z0-9-]}=-${dir}${odescr}
+	    opt2=${${match[1]}//[^a-zA-Z0-9_-]}=-${dir}${odescr}
 	  else
-	    opt2=${${opt}//[^a-zA-Z0-9-]}=${dir}${odescr}
+	    opt2=${${opt}//[^a-zA-Z0-9_-]}=${dir}${odescr}
 	  fi
 	  if [[ "$descr" = :\=* ]]; then
 	    cache+=( "${opt2}::${(L)${opt%\]}#*\=}: " )
@@ -247,7 +247,7 @@ if (( long )); then
 	  else
 	    odescr=
 	  fi
-	  opt2="${${opt%%\=*}//[^a-zA-Z0-9-]}=${dir}${odescr}"
+	  opt2="${${opt%%\=*}//[^a-zA-Z0-9_-]}=${dir}${odescr}"
 	  if [[ "$descr" = :\=* ]]; then
 	    cache+=( "${opt2}:${(L)${opt%\]}#*\=}: " )
 	  else
@@ -268,7 +268,7 @@ if (( long )); then
 	  # I discovered after about half an hour, so don't do that.
 	  "${(@)^${(@)tmp:#^*:*}//:/[}]"
 	  # commands with no description
-	  "${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9-]}")
+	  "${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9_-]}")
         if [[ -n "$descr" && "$descr" != ': :  ' ]]; then
 	  cache+=( "${(@)^tmp}${descr}" )
         else