Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug in sed completion



On Nov 10, 12:02am, Marc Chantreux wrote:
} Subject: Re: bug in sed completion
}
} Dan Nelson a écrit :
} 
} >Doesn't that mean you want your backup extension to be "s/x//" ?
} >
} no, it means that i don't need backup ( i alreasy have one in my DAT ;-) ).

If I'm reading the GNU sed docs correctly, the following patch should do
it.  Of course the first chunk of this is probably wrong for non-GNU with
--expression / --file, but I no longer have access to anything but Linux
machines so someone else will have to fix up that part.

This also fixes a typo (too many sss).

Index: Completion/Unix/Command/_sed
===================================================================
diff -c -r1.1 _sed
--- Completion/Unix/Command/_sed	12 Mar 2004 18:05:54 -0000	1.1
+++ Completion/Unix/Command/_sed	10 Nov 2005 03:44:47 -0000
@@ -4,16 +4,16 @@
 
 args=(
   '(-n --quiet --silent)'{-n,--quiet,--silent}'[suppress automatic printing of pattern space]'
-  '(1)*'{-e,--expresssion=}'[add sed commands to run]:sed script'
-  '(1)*'{-f,--file=}'[add contents of file to commands to run]:file:_files'
+  '(1)*'{-e,--expression=-}'[add sed commands to run]:sed script'
+  '(1)*'{-f,--file=-}'[add contents of file to commands to run]:file:_files'
   '(-e)1: :_guard "^-*" sed script'
   ':input file:_files'
 )
 
 if _pick_variant gnu=GNU unix --version; then
   args+=(
-    '(-i --in-place)'{-i,--in-place=}'[edit files in place]::suffix for backup'
-    '(-l --line-length)'{-l,--line-length=}'[specify line-wrap length for the l command]'
+    '(-i --in-place)'{-i-,--in-place=-}'[edit files in place]::suffix for backup'
+    '(-l --line-length)'{-l,--line-length=-}'[specify line-wrap length for the l command]'
     '(-r --regexp-extended)'{-r,--regexp-extended}'[use extended regular expressions]'
     '(-s --separate)'{-s,--separate}'[consider files separately instead of as a combined stream]'
     '(-u --unbuffered)'{-u,--unbuffered}'[disable data buffering]'


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


Messages sorted by: Reverse Date, Date, Thread, Author