Skip to content

Commit

Permalink
python: Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Mar 10, 2016
1 parent f17407b commit 235f726
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions completions/python
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,9 @@ _python()


# if -c or -m is already given, complete all kind of files.
local i
for (( i=0; i < $cword; i++ )); do
if [[ ${words[i]} == -[cm] ]]; then
_filedir
return
fi
done


if [[ "$cur" != -* ]]; then
if [[ "${words[@]::$cword}" == *\ -[cm]\ * ]]; then
_filedir
elif [[ "$cur" != -* ]]; then
_filedir 'py?([coz])'
else
COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
Expand Down

0 comments on commit 235f726

Please sign in to comment.