diff --git a/NEWS b/NEWS index ad05c3f3..fb77a343 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,8 @@ Patchutils news Added manual pages for gitdiff, gitdiffview, svndiff, and svndiffview commands. Addresses GitHub issue #112. + Updated bash completions. + 0.4.3 (stable) Added --in-place option to more tools for editing files in place. diff --git a/bash-completion-patchutils b/bash-completion-patchutils index c6f3cf84..9b7af811 100644 --- a/bash-completion-patchutils +++ b/bash-completion-patchutils @@ -6,8 +6,12 @@ _patchutils_common_opts() { echo "--help --version" } -_patchutils_filter_opts() { - echo "--exclude -x --exclude-from-file -X --include -i --include-from-file -I --hunks -# --lines --files -F --annotate --as-numbered-lines --format --remove-timestamps --clean --in-place --decompress -z --strip-match -p --strip --addprefix --addoldprefix --addnewprefix --git-prefixes" +_patchutils_shared_filter_opts() { + echo "--exclude -x --exclude-from-file -X --include -i --include-from-file -I --hunks -# --lines --files -F --decompress -z --strip-match -p --strip --addprefix --addoldprefix --addnewprefix --git-prefixes" +} + +_patchutils_filterdiff_only_opts() { + echo "--annotate --as-numbered-lines --format --remove-timestamps --clean --in-place" } _patchutils_list_opts() { @@ -35,7 +39,7 @@ _filterdiff() { cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - opts="$(_patchutils_common_opts) $(_patchutils_filter_opts) $(_patchutils_list_opts) --verbose -v --filter --grep --list" + opts="$(_patchutils_common_opts) $(_patchutils_shared_filter_opts) $(_patchutils_filterdiff_only_opts) $(_patchutils_list_opts) --verbose -v --filter --grep --list" case "${prev}" in --exclude|-x|--include|-i) @@ -95,7 +99,7 @@ _lsdiff() { cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - opts="$(_patchutils_common_opts) $(_patchutils_filter_opts) $(_patchutils_list_opts) --verbose -v --filter --grep" + opts="$(_patchutils_common_opts) $(_patchutils_shared_filter_opts) $(_patchutils_list_opts) --verbose -v --filter --grep" case "${prev}" in --exclude|-x|--include|-i) @@ -135,7 +139,7 @@ _grepdiff() { cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - opts="$(_patchutils_common_opts) $(_patchutils_filter_opts) $(_patchutils_list_opts) $(_patchutils_grep_opts) --verbose -v --filter --list" + opts="$(_patchutils_common_opts) $(_patchutils_shared_filter_opts) $(_patchutils_list_opts) $(_patchutils_grep_opts) --verbose -v --filter --list" case "${prev}" in --exclude|-x|--include|-i) @@ -367,7 +371,7 @@ _patchview() { prev="${COMP_WORDS[COMP_CWORD-1]}" # patchview is a wrapper around filterdiff, so use similar completion - opts="$(_patchutils_common_opts) $(_patchutils_filter_opts) --verbose -v --filter --grep" + opts="$(_patchutils_common_opts) $(_patchutils_shared_filter_opts) $(_patchutils_filterdiff_only_opts) --verbose -v --filter --grep" case "${prev}" in --exclude|-x|--include|-i) @@ -406,7 +410,7 @@ _gitdiff() { cur="${COMP_WORDS[COMP_CWORD]}" # These are wrappers that pass arguments to filterdiff - opts="$(_patchutils_filter_opts)" + opts="$(_patchutils_shared_filter_opts) $(_patchutils_filterdiff_only_opts)" if [[ ${cur} == -* ]]; then COMPREPLY=($(compgen -W "${opts}" -- ${cur}))