bashject: enable filedir completion for add second arg
authorBenjamin Doumenc <big.clop@gmail.com>
Wed, 24 Jul 2013 08:31:45 +0000 (10:31 +0200)
committerBenjamin Doumenc <big.clop@gmail.com>
Wed, 24 Jul 2013 08:31:45 +0000 (10:31 +0200)
bash/bashject

index 8a095e5..e7b0f9c 100644 (file)
@@ -287,15 +287,17 @@ function _bashject_complete() {
     # Complete command name 
     if [ $COMP_CWORD -eq 1 ]; then
         _bashject_complete_command 1
-    else
-        if [ $COMP_CWORD -eq 2 ]; then
-            case ${COMP_WORDS[1]} in
-                s|set|source|edit|path|rm|remove|rename)       _bashject_complete_project_name           1 ;;
-                help)                                          _bashject_complete_command                1 ;;
-                names|list|cd)                                                                       ;;
-                a|add)                                                                               ;;
-            esac
-        fi
+    elif [ $COMP_CWORD -eq 2 ]; then
+        case ${COMP_WORDS[1]} in
+            s|set|source|edit|path|rm|remove|rename)       _bashject_complete_project_name           1 ;;
+            help)                                          _bashject_complete_command                1 ;;
+            names|list|cd)                                                                             ;;
+            a|add)                                                                                     ;;
+        esac
+    elif [ $COMP_CWORD -eq 3 ]; then
+        case ${COMP_WORDS[1]} in
+            a|add)                                         _filedir                                  1 ;;
+        esac
     fi
 }