##// END OF EJS Templates
use help-all to get all options and add profile specializations
Julian Taylor -
Show More
@@ -9,15 +9,7 b' _ipython_get_flags()'
9 9 opts=$__ipython_complete_last_res
10 10 return
11 11 fi
12 opts=$(cat <<EOF | python -
13 try:
14 import IPython.${url} as mod;
15 for k in mod.${var}:
16 print "${dash}%s" % k,
17 except:
18 pass
19 EOF
20 )
12 opts=$(ipython ${url} --help-all | grep -E "^-{1,2}[^-]" | sed -e "s/=.*//;s/ <.*//")
21 13 __ipython_complete_last="$url $var"
22 14 __ipython_complete_last_res="$opts"
23 15 }
@@ -43,16 +35,20 b' _ipython()'
43 35
44 36 if [[ ${cur} == -* ]]; then
45 37 if [[ $mode == "notebook" ]]; then
46 _ipython_get_flags frontend.html.notebook.notebookapp notebook_flags "--"
38 _ipython_get_flags notebook
47 39 opts=$"${opts} ${baseopts}"
48 40 elif [[ $mode == "qtconsole" ]]; then
49 _ipython_get_flags frontend.qt.console.qtconsoleapp qt_flags "--"
41 _ipython_get_flags qtconsole
50 42 opts="${opts} ${baseopts}"
51 43 elif [[ $mode == "console" ]]; then
52 _ipython_get_flags frontend.terminal.console.app frontend_flags "--"
44 _ipython_get_flags console
53 45 elif [[ $mode == "kernel" ]]; then
54 _ipython_get_flags zmq.kernelapp "kernel_flags.keys()" "--"
46 _ipython_get_flags kernel
55 47 opts="${opts} ${baseopts}"
48 elif [[ $mode == "profile" ]]; then
49 opts="list create"
50 elif [[ $mode == "locate" ]]; then
51 opts=""
56 52 else
57 53 opts=$baseopts
58 54 fi
@@ -61,6 +57,22 b' _ipython()'
61 57 elif [[ ${prev} == "--pylab"* ]] || [[ ${prev} == "--gui"* ]]; then
62 58 _ipython_get_flags core.shellapp InteractiveShellApp.pylab.values
63 59 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
60 elif [[ ${prev} == "--profile"* ]]; then
61 if [ -z "$__ipython_complete_profiles" ]; then
62 __ipython_complete_profiles=$(cat <<EOF | python -
63 try:
64 import IPython.core.profileapp
65 for k in IPython.core.profileapp.list_bundled_profiles():
66 print "%s" % k,
67 p = IPython.core.profileapp.ProfileList()
68 for k in IPython.core.profileapp.list_profiles_in(p.ipython_dir):
69 print "%s" % k,
70 except:
71 pass
72 EOF
73 )
74 fi
75 COMPREPLY=( $(compgen -W "${__ipython_complete_profiles}" -- ${cur}) )
64 76 else
65 77 if [ -z "$mode" ]; then
66 78 COMPREPLY=( $(compgen -f -W "${subcommands}" -- ${cur}) )
General Comments 0
You need to be logged in to leave comments. Login now