From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20010 invoked by alias); 8 Jul 2015 01:15:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35727 Received: (qmail 16631 invoked from network); 8 Jul 2015 01:15:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=8Q7hki8j+oLARGvvA+9heWkgApuJfiYYsfUC+AkKZaM=; b=WCY8fjOnC3rcPZZNqOrC6iSIZ3be/3Jphn3fAWbAMy8BSJZx7gmP2mjbBSshW12KkO duCbC+vd5r7TcL2pumdKus0OMkoR37oPuK2HannuuOXXOYLuOmN+SvKlU+Hz7gRji+x8 taLJ8tVe8vKlTzZRVogCstirbzcL3W20ZLfmAb1VcNJlQuyBqdGP3vu//2YQJqT0ihSb lDlfm75RJi71gq+kIa1zaIOJg1QWILxXVJa3Dxt8vMBa9V5hwxw7JKgI2nXgvnZ+ohE5 fCrokDheY5iyw4s2Ar6uJAMbYzj/40c8RN99NIT1tGD+K6VynuAopouMXMdblW8Uj9Qh wyVQ== MIME-Version: 1.0 X-Received: by 10.13.231.133 with SMTP id q127mr8244324ywe.66.1436318138483; Tue, 07 Jul 2015 18:15:38 -0700 (PDT) Date: Tue, 7 Jul 2015 20:15:38 -0500 Message-ID: Subject: PATCH: Add OpenBSD to _diff_options From: Matthew Martin To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Based of a patch that has been sitting in OpenBSD's ports tree for quite some time. I don't know if it's OK to add -s to _arguments for Solaris, but that is what the original patch did. - Matthew Martin diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index d76c265..1345e71 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="$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="$of -C -h -n -D" args+=( - '-i[case insensitive]' + '-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' + '-w[ignore all white space]' + "($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[report on identical files]' '-S+[set first file in comparison]:start with file:_files' ) ;; + openbsd*) + of="$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 with NUMBER lines of context]: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' + '-s[report files that are the same]' + '*-X[Exclude files and subdirectories whose basenames match lines in a file]:file name' + '-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]' \ "$@"