From b8df07ad0615ad593da45973f80afafd018e710f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 29 Aug 2018 16:56:30 +0200 Subject: 43351: handle the new diff implementation in the pre-release version of FreeBSD 12 --- Completion/Unix/Type/_diff_options | 121 +++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index 55ddecd2a..4fd27442e 100644 --- a/Completion/Unix/Type/_diff_options +++ b/Completion/Unix/Type/_diff_options @@ -1,6 +1,6 @@ #autoload -local of ofwuc ouc oss ofwy ofwg ofwl cmd +local of ofwuc ouc oss ofwy ofwg ofwl cmd variant local -a args cmd="$1" @@ -25,16 +25,16 @@ _diff_palette() { return ret } -if _pick_variant -c $cmd gnu=GNU unix -v; then +if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12->.* ]]; then # output formats of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \ --unified --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format --line-format --old-line-format --new-line-format \ - --unchanged-line-format --normal -D --ifdef" + --unchanged-line-format -D --ifdef" # output formats w/o unified and context ofwuc="-y --side-by-side -n --rcs -e -f --ed -q --brief --old-group-format \ - --new-group-format --changed-group-format --unchanged-group-format --normal \ + --new-group-format --changed-group-format --unchanged-group-format \ --line-format --old-line-format --new-line-format --unchanged-line-format \ -D --ifdef" @@ -48,26 +48,50 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then ofwy="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format --line-format --old-line-format \ - --new-line-format --unchanged-line-format --normal -D --ifdef" + --new-line-format --unchanged-line-format -D --ifdef" # output formats w/o group format - ofwg="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified --normal \ + ofwg="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ --line-format --old-line-format --new-line-format --unchanged-line-format -D --ifdef" # output formats w/o line format ofwl="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ - --old-group-format --new-group-format --changed-group-format --normal \ + --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format" - _arguments -s \ + if [[ $variant = gnu ]]; then + (( $#words > 2 )) || args+=( + '(-v --version)'{-v,--version}'[display version information]' + '--help[display usage information]' + ) + args+=( + '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' + '(-E --ignore-tab-expansion)'{-E,--ignore-tab-expansion}'[ignore changes due to tab expansion]' + '(-Z --ignore-trailing-space)'{-Z,--ignore-trailing-space}'[ignore white space at line end]' + "($ofwuc $oss -F --show-function-line)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' + "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' + "($ofwy $ouc)--left-column[output only left column of common lines]" + "($ofwy $ouc)--suppress-common-lines[do not output common lines]" + "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format" + "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format" + "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" + '(--to-file)--from-file=[compare specified file to all oper