From: Nathan Houghton <firstname.lastname@example.org>
Cc: Nathan Houghton <email@example.com>
Subject: [PATCH] Fix diff completion for non GNU / FreeBSD platforms
Date: Wed, 4 Jan 2023 14:44:18 -0800 [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
On OpenBSD, "diff -urpN dir1/ di<TAB>" would refuse to complete a second
filename/directory name. This was caused by the -u and -U options
getting dropped from args (overwriting args vs appending).
- Fully build up $of before utilizing it to avoid inconsistent
behavior in the treatment of mutually exclusive output formats.
- Remove the "-l" option for OpenBSD (this flag was removed in
- Mark the "-x" option as being repeatable on OpenBSD
Completion/Unix/Type/_diff_options | 41 +++++++++++++++++++-----------
1 file changed, 26 insertions(+), 15 deletions(-)
diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options
index dfa9889f2..2646527df 100644
@@ -133,33 +133,44 @@ else
case $OSTYPE in
of+=' -u -U'
+ of+=' -n -C -D'
+ of+=' -h'
+ of+=' -q'
+ # modifications to "$of" should be done above this line so that it is
+ # uniformly defined while constructing $args
- "($of)-u[output a unified diff]"
- "($of)-U+[output a unified diff]:lines of context"
+ "($of)-u[output a unified diff]"
+ "($of)-U+[output a unified diff]:lines of context"
- "($of)-C+[output a context diff]:lines of context"
- "($of)-D+[output merged file with preprocessor directives]:preprocessor symbol"
- '-i[case insensitive]'
- '-l[long output format (paginate with pr(1))]'
- '-s[report on identical files]'
- '-t[expand tabs in output lines]'
+ "($of)-C+[output a context diff]:lines of context"
+ "($of)-D+[output merged file with preprocessor directives]:preprocessor symbol"
+ '-i[case insensitive]'
+ '-s[report on identical files]'
+ '-t[expand tabs in output lines]'
- of+=' -h -n'
- '-w[ignore all white space]'
- "($of)-h[do a fast, half-hearted job]"
- "($of)-n[output a reversed ed script]"
+ '-w[ignore all white space]'
+ "($of)-h[do a fast, half-hearted job]"
+ "($of)-n[output a reversed ed script]"
'-S+[set first file in comparison]:start with file:_files'
+ '-l[long output format (paginate with pr(1))]'
- of+=' -n -q -u -C -D -U'
"($of)-n[output an rcsdiff(1)-compatible diff]"
"($of)-q[only print a line when the files differ; does not produce a list of changes]"
'-a[treat all files as ASCII text]'
@@ -173,7 +184,7 @@ else
'-P[treat absent files in the second directory as if they were empty]'
'-S[start a directory diff from a file name]:file name:_files'
'*-X[exclude files and subdirectories whose basenames match lines in a file]:file name:_files'
- '-x[exclude files and subdirectories whose basenames match a pattern]:pattern'
+ '*-x[exclude files and subdirectories whose basenames match a pattern]:pattern'
reply other threads:[~2023-01-04 22:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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
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).