ovs-appctl-bashcomp: Use better function to complete file.
authorAlex Wang <alexw@nicira.com>
Wed, 18 Mar 2015 17:44:27 +0000 (10:44 -0700)
committerAlex Wang <alexw@nicira.com>
Wed, 18 Mar 2015 19:30:47 +0000 (12:30 -0700)
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@nicira.com>
utilities/ovs-appctl-bashcomp.bash

index 0d83549..67a268e 100755 (executable)
@@ -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