##// END OF EJS Templates
bash completion: history clear & trim handle flags
Paul Ivanov -
Show More
@@ -54,8 +54,9 b' _ipython()'
54 _ipython_get_flags $mode
54 _ipython_get_flags $mode
55 ;;
55 ;;
56 "history")
56 "history")
57 if [[ "${COMP_WORDS[2]}" == "trim" ]]; then
57 if [[ $COMP_CWORD -ge 2 ]]; then
58 _ipython_get_flags "history trim"
58 # 'history trim' and 'history clear' covered by next line
59 _ipython_get_flags history\ "${COMP_WORDS[2]}"
59 else
60 else
60 _ipython_get_flags $mode
61 _ipython_get_flags $mode
61
62
@@ -71,13 +72,17 b' _ipython()'
71 return 0
72 return 0
72 elif [[ $mode == "profile" ]]; then
73 elif [[ $mode == "profile" ]]; then
73 opts="list create locate"
74 opts="list create locate "
75 local IFS=$'\t\n'
74 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
76 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
75 elif [[ $mode == "history" ]]; then
77 elif [[ $mode == "history" ]]; then
76 if [[ "${COMP_WORDS[2]}" == "trim" ]]; then
78 if [[ $COMP_CWORD -ge 3 ]]; then
77 COMPREPLY="--"
79 # drop into flags
80 opts="--"
78 else
81 else
79 COMPREPLY="trim "
82 opts="trim clear "
80 fi
83 fi
84 local IFS=$'\t\n'
85 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
81 elif [[ $mode == "locate" ]]; then
86 elif [[ $mode == "locate" ]]; then
82 opts="profile"
87 opts="profile"
83 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
88 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
General Comments 0
You need to be logged in to leave comments. Login now