[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-3-gf96e154

Ville Skyttä ville.skytta at iki.fi
Mon Feb 7 19:01:25 UTC 2011


The following commit has been merged in the master branch:
commit d066ace4cbca7f5da611f0fee2497e24e9d84f67
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Feb 7 20:59:01 2011 +0200

    Do file completion after gendiff output redirection.
    
    Common use case is "gendiff DIR EXTENSION > FILE".

diff --git a/CHANGES b/CHANGES
index f2dca4f..860f639 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 bash-completion (2.x)
 
+  [ Ville Skyttä ]
+  * Improve gendiff completion.
+
  -- David Paleino <d.paleino at gmail.com>  Sun, 06 Feb 2011 21:46:37 +0100
 
 bash-completion (1.3)
diff --git a/completions/rpm b/completions/rpm
index bbab036..5838365 100644
--- a/completions/rpm
+++ b/completions/rpm
@@ -294,9 +294,13 @@ have gendiff &&
 _gendiff()
 {
     COMPREPLY=()
-    local cur cword
-    _get_comp_words_by_ref cur cword
-    [[ $cword != 1 ]] || _filedir -d
+    local cur prev cword
+    _get_comp_words_by_ref cur prev cword
+    if [[ $cword -eq 1 ]]; then
+        _filedir -d
+    elif [[ $prev == *\> ]]; then
+        _filedir
+    fi
 } &&
 complete -F _gendiff gendiff
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list