diff options
author | Oliver Kiddle <opk@zsh.org> | 2016-08-19 18:00:07 +0200 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2016-08-19 18:00:07 +0200 |
commit | 580698bc7136454941dd6bbc2ca70f240fabc6b7 (patch) | |
tree | 5f64057da3d5482c4e7f2c8242bfe2bc7de62299 /Completion/Unix/Type | |
parent | 283357dcabb84d90825c3acb37e88dda45fd744d (diff) | |
download | zsh-580698bc7136454941dd6bbc2ca70f240fabc6b7.tar.gz zsh-580698bc7136454941dd6bbc2ca70f240fabc6b7.tar.xz zsh-580698bc7136454941dd6bbc2ca70f240fabc6b7.zip |
39067: update options to correspond to latest versions of software in various functions
Diffstat (limited to 'Completion/Unix/Type')
-rw-r--r-- | Completion/Unix/Type/_diff_options | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index 6af392a13..55ddecd2a 100644 --- a/Completion/Unix/Type/_diff_options +++ b/Completion/Unix/Type/_diff_options @@ -6,6 +6,25 @@ local -a args cmd="$1" shift +_diff_palette() { + local context state line ret=1 + local -a suf + _values -s : attribute \ + "ad[added text]:attribute [32]:->attrs" \ + "de[deleted text]:attribute [31]:->attrs" \ + "hd[header]:attribute [1]:->attrs" \ + "ln[line numbers]:attribute [36]:->attrs" \ + "rs[rest - other text]:attribute [0]:->attrs" && ret=0 + if [[ -n $state ]]; then + compset -P '*;' + compset -S '[;=]*' || suf=( -S: -r ": ;\\\t\n\=" ) + _alternative -C context -O suf \ + 'attributes:attributes:((0:reset 1:bold 3:italics 4:underline 5:blink))' \ + 'colors:color:((30:default 31:red 32:green 33:yellow 34:blue 35:magenta 36:cyan 37:white))' && ret=0 + fi + return ret +} + if _pick_variant -c $cmd gnu=GNU unix -v; then # output formats of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \ @@ -46,6 +65,7 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then '(--no-ignore-file-name-case)--ignore-file-name-case[ignore case when comparing file names]' \ '(--ignore-file-name-case)--no-ignore-file-name-case[consider case when comparing file names]' \ '(-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]' \ '(-b --ignore-space-change)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ '(--ignore-all-space -w)'{--ignore-all-space,-w}'[ignore all white space]' \ '(-B --ignore-blank-lines)'{-B,--ignore-blank-lines}'[ignore lines that are all blank]' \ @@ -56,7 +76,7 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then "($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]" \ - "($ofwuc $oss)*"{-L+,--label=}'[set label to use instead of file name]:label' \ + "($ofwuc $oss)*"{-L+,--label=}'[set label to use instead of file name and timestamp]:label' \ "($ofwuc $oss -p --show-c-function)"{-p,--show-c-function}'[show C function of each change]' \ "($ofwuc $oss -F --show-function-line)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' \ "($of $ouc $oss)--brief[output only whether files differ]" \ @@ -84,8 +104,9 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then '(-l --paginate)'{-l,--paginate}'[output through pr]' \ '(-t --expand-tabs)'{-t,--expand-tabs}'[expand tabs to spaces]' \ '(-T --initial-tab)'{-T,--initial-tab}'[prepend a tab]' \ - '--tabsize=[specify width of tab]:width' \ + '--tabsize=[specify width of tab]:width [8]' \ '(-r --recursive)'{-r,--recursive}'[recursively compare subdirectories]' \ + "--no-dereference[don't follow symbolic links]" \ '(-N --new-file)'{-N,--new-file}'[treat absent files as empty]' \ '(-P --unidirectional-new-file)'{-P,--unidirectional-new-file}'[treat absent first files as empty]' \ '(-s --report-identical-files)'{-s,--report-identical-files}'[report when two files are the same]' \ @@ -97,6 +118,8 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines' \ '(-d --minimal)'{-d,--minimal}'[try to find a smaller set of changes]' \ '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' \ + '--color=-[use colors in output]::when [auto]:(never always auto)' \ + '--palette=[specify colors to use]:color:_diff_palette' \ '(-v --version)'{-v,--version}'[display version info]' \ '--help[display help info]' \ "$@" |