about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorMatthew Martin <phy1729@gmail.com>2015-07-08 11:45:04 +0200
committerOliver Kiddle <opk@zsh.org>2015-07-08 11:45:04 +0200
commit39bc7a212fc19ec135bd00b3c140076c622efd47 (patch)
treeb5659523df8b77274b7c3c7cc094bbd7872d8789 /Completion
parent1b4bdcdf3e99ee3b61b9bed8e3705dc2821ce6c4 (diff)
downloadzsh-39bc7a212fc19ec135bd00b3c140076c622efd47.tar.gz
zsh-39bc7a212fc19ec135bd00b3c140076c622efd47.tar.xz
zsh-39bc7a212fc19ec135bd00b3c140076c622efd47.zip
35727: support OpenBSD for diff options
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_diff_options52
1 files changed, 41 insertions, 11 deletions
diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options
index d76c265ca..6af392a13 100644
--- a/Completion/Unix/Type/_diff_options
+++ b/Completion/Unix/Type/_diff_options
@@ -101,33 +101,63 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then
     '--help[display help info]' \
     "$@"
 else
+  of='-c -e -f'
   case $OSTYPE in
     solaris2.<9->)
+      of+=' -u -U'
       args=(
-	'(-c -e -f -C -U)-u[output a unified diff]'
-	'(-c -e -f -C -u)-U[output a unified diff]:lines of context'
+	"($of)-u[output a unified diff]"
+	"($of)-U[output a unified diff]:lines of context"
       )
     ;&
     solaris*)
+      of+=' -C -h -n -D'
       args+=(
 	'-i[case insensitive]'
         '-t[expand tabs to spaces]'
 	'-w[ignore all white space]'
-	'(-c -e -f -n -u -U -h -D)-C+[output a context diff]:lines of context'
-	'(-c -e -f -n -u -U -C -D)-h[do a fast, half-hearted job]'
-	'(-c -e -f -u -U -h -C -D)-n[reversed ed script]'
-	'(-c -e -f -n -u -U -h -C)-D[output merged file with preprocessor directives]:preprocessor symbol'
+	"($of)-C+[output a context diff]:lines of context"
+	"($of)-h[do a fast, half-hearted job]"
+	"($of)-n[reversed ed script]"
+	"($of)-D[output merged file with preprocessor directives]:preprocessor symbol"
         '-l[output through pr]'
 	'-s[report on identical files]'
         '-S+[set first file in comparison]:start with file:_files'
       )
     ;;
+    openbsd*)
+      of+=' -n -q -u -C -D -U'
+      args=(
+        "($of)-n[produce an rcsdiff(1)-compatible diff]"
+        "($of)-q[only print a line when the files differ; does not produce a list of changes]"
+        "($of)-u[produce a unified diff with 3 lines of context]"
+        "($of)-C+[produce a context diff]:number of lines of context"
+        "($of)-D[produce a merged file with preprocessor directives]:preprocessor symbol"
+        "($of)-U+[produce a unified diff]:number of lines of context"
+        '-a[treat all files as ASCII text]'
+        '-d[try to produce the smallest diff possible]'
+        '-I[ignore changes whose lines match the extended regular expression]:extended regular expression pattern'
+        '-i[ignore case]'
+        '*-L[print a label instead of the file name and time]:label'
+        '-l[long output format (paginate with pr(1))]'
+        '-p[show characters from the last line before the context]'
+        '-T[consistently align tabs]'
+        '-t[expand tabs in output lines]'
+        '-w[like -b, but totally ignore whitespace]'
+        '-N[treat absent files in either directory as if they were empty]'
+        '-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'
+        '-s[report files that are the same]'
+        '*-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'
+      )
+    ;;
   esac
-  
-  _arguments "$args[@]" \
-    "(-e -f -u -n)-c[output a context diff]" \
-    "(-c -f -u -n)-e[output an ed script]" \
-    "(-c -e -u -n)-f[output a reversed ed script]" \
+
+  _arguments -s "$args[@]" \
+    "($of)-c[output a context diff]" \
+    "($of)-e[output an ed script]" \
+    "($of)-f[output a reversed ed script]" \
     '-b[skip trailing white spaces]' \
     '-r[recursively compare subdirectories]' \
     "$@"