##// 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 opts=$__ipython_complete_last_res
9 opts=$__ipython_complete_last_res
10 return
10 return
11 fi
11 fi
12 opts=$(cat <<EOF | python -
12 opts=$(ipython ${url} --help-all | grep -E "^-{1,2}[^-]" | sed -e "s/=.*//;s/ <.*//")
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 )
21 __ipython_complete_last="$url $var"
13 __ipython_complete_last="$url $var"
22 __ipython_complete_last_res="$opts"
14 __ipython_complete_last_res="$opts"
23 }
15 }
@@ -43,16 +35,20 b' _ipython()'
43
35
44 if [[ ${cur} == -* ]]; then
36 if [[ ${cur} == -* ]]; then
45 if [[ $mode == "notebook" ]]; then
37 if [[ $mode == "notebook" ]]; then
46 _ipython_get_flags frontend.html.notebook.notebookapp notebook_flags "--"
38 _ipython_get_flags notebook
47 opts=$"${opts} ${baseopts}"
39 opts=$"${opts} ${baseopts}"
48 elif [[ $mode == "qtconsole" ]]; then
40 elif [[ $mode == "qtconsole" ]]; then
49 _ipython_get_flags frontend.qt.console.qtconsoleapp qt_flags "--"
41 _ipython_get_flags qtconsole
50 opts="${opts} ${baseopts}"
42 opts="${opts} ${baseopts}"
51 elif [[ $mode == "console" ]]; then
43 elif [[ $mode == "console" ]]; then
52 _ipython_get_flags frontend.terminal.console.app frontend_flags "--"
44 _ipython_get_flags console
53 elif [[ $mode == "kernel" ]]; then
45 elif [[ $mode == "kernel" ]]; then
54 _ipython_get_flags zmq.kernelapp "kernel_flags.keys()" "--"
46 _ipython_get_flags kernel
55 opts="${opts} ${baseopts}"
47 opts="${opts} ${baseopts}"
48 elif [[ $mode == "profile" ]]; then
49 opts="list create"
50 elif [[ $mode == "locate" ]]; then
51 opts=""
56 else
52 else
57 opts=$baseopts
53 opts=$baseopts
58 fi
54 fi
@@ -61,6 +57,22 b' _ipython()'
61 elif [[ ${prev} == "--pylab"* ]] || [[ ${prev} == "--gui"* ]]; then
57 elif [[ ${prev} == "--pylab"* ]] || [[ ${prev} == "--gui"* ]]; then
62 _ipython_get_flags core.shellapp InteractiveShellApp.pylab.values
58 _ipython_get_flags core.shellapp InteractiveShellApp.pylab.values
63 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
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 else
76 else
65 if [ -z "$mode" ]; then
77 if [ -z "$mode" ]; then
66 COMPREPLY=( $(compgen -f -W "${subcommands}" -- ${cur}) )
78 COMPREPLY=( $(compgen -f -W "${subcommands}" -- ${cur}) )
General Comments 0
You need to be logged in to leave comments. Login now