[ovs-dev] [PATCH] ovs-appctl-bashcomp: Use better function to complete file.

Alex Wang alexw at nicira.com
Wed Mar 18 18:26:57 UTC 2015


This commit uses the _filedir function defined in bash_completion
module for file completion.  It will take care of the '/' suffix
for directory.

Signed-off-by: Alex Wang <alexw at nicira.com>
---
 utilities/ovs-appctl-bashcomp.bash |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utilities/ovs-appctl-bashcomp.bash b/utilities/ovs-appctl-bashcomp.bash
index 0d83549..67a268e 100755
--- a/utilities/ovs-appctl-bashcomp.bash
+++ b/utilities/ovs-appctl-bashcomp.bash
@@ -589,8 +589,9 @@ _ovs_command_complete() {
           COMPREPLY=( $(compgen -W "$(echo $_COMP_WORDLIST | tr ' ' '\n' \
                                  | sort -u | sed -e '/NO_EXPAN/d')" -- $cur) )
       else
+          compopt -o nospace
           # If there is no completions, just complete on file path.
-          COMPREPLY=( $(compgen -o filenames -A file -- $cur) )
+          _filedir
       fi
   fi
 
-- 
1.7.9.5




More information about the dev mailing list