##// END OF EJS Templates
keep the trailing = of options
Julian Taylor -
Show More
@@ -9,7 +9,9 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=$(ipython ${url} --help-all | grep -E "^-{1,2}[^-]" | sed -e "s/=.*//;s/ <.*//")
12 # pylab and profile don't need the = and the
13 # version without simplifies the special cased completion
14 opts=$(ipython ${url} --help-all | grep -E "^-{1,2}[^-]" | sed -e "s/<.*//" -e "s/[^=]$/& /" -e "s/^--pylab=$//" -e "s/^--profile=$/--profile /")
13 __ipython_complete_last="$url $var"
15 __ipython_complete_last="$url $var"
14 __ipython_complete_last_res="$opts"
16 __ipython_complete_last_res="$opts"
15 }
17 }
@@ -57,6 +59,8 b' _ipython()'
57 else
59 else
58 opts=$baseopts
60 opts=$baseopts
59 fi
61 fi
62 # don't drop the trailing space
63 local IFS=$'\t\n'
60 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
64 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
61 return 0
65 return 0
62 elif [[ ${prev} == "--pylab"* ]] || [[ ${prev} == "--gui"* ]]; then
66 elif [[ ${prev} == "--pylab"* ]] || [[ ${prev} == "--gui"* ]]; then
@@ -65,12 +69,13 b' _ipython()'
65 try:
69 try:
66 import IPython.core.shellapp as mod;
70 import IPython.core.shellapp as mod;
67 for k in mod.InteractiveShellApp.pylab.values:
71 for k in mod.InteractiveShellApp.pylab.values:
68 print "%s" % k,
72 print "%s " % k
69 except:
73 except:
70 pass
74 pass
71 EOF
75 EOF
72 )
76 )
73 fi
77 fi
78 local IFS=$'\t\n'
74 COMPREPLY=( $(compgen -W "${__ipython_complete_pylab}" -- ${cur}) )
79 COMPREPLY=( $(compgen -W "${__ipython_complete_pylab}" -- ${cur}) )
75 elif [[ ${prev} == "--profile"* ]]; then
80 elif [[ ${prev} == "--profile"* ]]; then
76 if [ -z "$__ipython_complete_profiles" ]; then
81 if [ -z "$__ipython_complete_profiles" ]; then
@@ -78,15 +83,16 b' EOF'
78 try:
83 try:
79 import IPython.core.profileapp
84 import IPython.core.profileapp
80 for k in IPython.core.profileapp.list_bundled_profiles():
85 for k in IPython.core.profileapp.list_bundled_profiles():
81 print "%s" % k,
86 print "%s " % k
82 p = IPython.core.profileapp.ProfileList()
87 p = IPython.core.profileapp.ProfileList()
83 for k in IPython.core.profileapp.list_profiles_in(p.ipython_dir):
88 for k in IPython.core.profileapp.list_profiles_in(p.ipython_dir):
84 print "%s" % k,
89 print "%s " % k
85 except:
90 except:
86 pass
91 pass
87 EOF
92 EOF
88 )
93 )
89 fi
94 fi
95 local IFS=$'\t\n'
90 COMPREPLY=( $(compgen -W "${__ipython_complete_profiles}" -- ${cur}) )
96 COMPREPLY=( $(compgen -W "${__ipython_complete_profiles}" -- ${cur}) )
91 else
97 else
92 if [ -z "$mode" ]; then
98 if [ -z "$mode" ]; then
@@ -97,4 +103,4 b' EOF'
97 fi
103 fi
98
104
99 }
105 }
100 complete -o default -F _ipython ipython
106 complete -o default -o nospace -F _ipython ipython
General Comments 0
You need to be logged in to leave comments. Login now