##// END OF EJS Templates
bash completion: generalize subcmd completer logic
Paul Ivanov -
Show More
@@ -47,22 +47,18 b' _ipython()'
47 47 opts="list create"
48 48 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
49 49 elif [[ ${cur} == -* ]]; then
50 if [[ $mode == "notebook" ]]; then
51 _ipython_get_flags notebook
50 case $mode in
51 "notebook" | "qtconsole" | "console" | "kernel")
52 _ipython_get_flags $mode
52 53 opts=$"${opts} ${baseopts}"
53 elif [[ $mode == "qtconsole" ]]; then
54 _ipython_get_flags qtconsole
55 opts="${opts} ${baseopts}"
56 elif [[ $mode == "console" ]]; then
57 _ipython_get_flags console
58 elif [[ $mode == "kernel" ]]; then
59 _ipython_get_flags kernel
60 opts="${opts} ${baseopts}"
61 elif [[ $mode == "locate" ]]; then
62 opts=""
63 else
54 ;;
55 "locate" | "history" | "profile")
56 _ipython_get_flags $mode
57 opts=$"${opts}"
58 ;;
59 *)
64 60 opts=$baseopts
65 fi
61 esac
66 62 # don't drop the trailing space
67 63 local IFS=$'\t\n'
68 64 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
General Comments 0
You need to be logged in to leave comments. Login now