From 50a467b44dfbcf2cf2f73e3dc717ddba0de0d9f2 2012-08-27 18:16:00
From: Julian Taylor <jtaylor.debian@googlemail.com>
Date: 2012-08-27 18:16:00
Subject: [PATCH] fix profile subcommand completion

---

diff --git a/docs/examples/core/ipython-completion.bash b/docs/examples/core/ipython-completion.bash
index 58d7764..ac0efe6 100644
--- a/docs/examples/core/ipython-completion.bash
+++ b/docs/examples/core/ipython-completion.bash
@@ -21,7 +21,7 @@ _ipython()
     local subcommands="notebook qtconsole console kernel profile locate"
     local opts=""
     if [ -z "$__ipython_complete_baseopts" ]; then
-        _ipython_get_flags core.shellapp "shell_flags.keys()" "--"
+        _ipython_get_flags baseopts
         __ipython_complete_baseopts="${opts}"
     fi
     local baseopts="$__ipython_complete_baseopts"
@@ -37,7 +37,10 @@ _ipython()
         fi
     done
 
-    if [[ ${cur} == -* ]]; then
+    if [[ $mode == "profile" ]]; then
+        opts="list create"
+        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+    elif [[ ${cur} == -* ]]; then
         if [[ $mode == "notebook" ]]; then
             _ipython_get_flags notebook
             opts=$"${opts} ${baseopts}"
@@ -49,8 +52,6 @@ _ipython()
         elif [[ $mode == "kernel" ]]; then
             _ipython_get_flags kernel
             opts="${opts} ${baseopts}"
-        elif [[ $mode == "profile" ]]; then
-            opts="list create"
         elif [[ $mode == "locate" ]]; then
             opts=""
         else