Skip to content

Commit

Permalink
flake8: Various option arg completion improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Dec 16, 2017
1 parent 9cddfdf commit 15389e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 10 additions & 3 deletions completions/flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@ _flake8()
_init_completion -s || return

case $prev in
-h|--help|--version|--exclude|--filename|--select|--ignore|\
--max-line-length|--max-complexity|--builtins)
-h|--help|--version)
return
;;
--format)
COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) )
return
;;
--config)
-j|--jobs)
COMPREPLY=( $( compgen -W "auto {1..$(_ncpus)}" -- "$cur" ) )
return
;;
--output-file|--append-config|--config)
_filedir
return
;;
--include-in-doctest|--exclude-from-doctest)
_filedir py
return
;;
esac

$split && return
Expand Down
6 changes: 6 additions & 0 deletions test/lib/completions/flake8.exp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@ setup
assert_complete_any "flake8 "
sync_after_int

assert_complete_any "flake8 -"
sync_after_int

assert_no_complete "flake8 --doesnt-exist="
sync_after_int


teardown

0 comments on commit 15389e6

Please sign in to comment.