zsh-workers
 help / color / mirror / code / Atom feed
From: Ulrik Haugen <qha@lysator.liu.se>
To: zsh-workers@sunsite.dk
Subject: PATCH for _diff_options to allow argument to -u
Date: Tue, 19 Apr 2005 22:59:29 +0200	[thread overview]
Message-ID: <87is2i1o0e.fsf@haugen.visit.se> (raw)

Hello!

I recently discovered that you can control the amount of context that
diff -u or -c gives you. Shortly thereafter it became very annoying
that the zsh completion sees characters (other than other option
characters) immediately following -u (or -c) as the original file name
and thus won't complete the new file once you get as far as "diff -u0
orig". The patch below makes the completion treat them the same way
the option handling in diff does.

This leaves the completion still thinking A is the original file name
if you type for instance "diff -wA orig" whereas diff complains that A
is an invalid option, but since diff will make you retype the command
anyway it's not necessarily worth fixing.

--- /usr/share/zsh/4.2.5/functions/Completion/Unix/_diff_options        2005-04-06 17:30:29.000000000 +0200
+++ init/zshfunctions/_diff_options     2005-03-25 01:09:27.000000000 +0100
@@ -56,4 +56,2 @@
-    "($of $oss)"{-C+,--context=-}'[output a context diff]:number of lines of copied context' \
-    "($of $oss)-c[output a context diff]" \
-    "($of $oss)"{-U+,--unified=-}'[output a unified diff]:number of lines of unified context' \
-    "($of $oss)-u[output a unified diff]" \
+    "($of $oss)"{-c-,-C+,--context=-}'[output a context diff]:number of lines of copied context' \
+    "($of $oss)"{-u-,-U+,--unified=-}'[output a unified diff]:number of lines of unified context' \


             reply	other threads:[~2005-04-19 23:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19 20:59 Ulrik Haugen [this message]
2005-04-25  8:13 ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87is2i1o0e.fsf@haugen.visit.se \
    --to=qha@lysator.liu.se \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).