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