[Bash-completion-commits] [bash-completion] 02/02: flake8: New completion

Ville Skyttä scop-guest at moszumanska.debian.org
Sat Feb 8 18:59:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit 5152356ad1b0c8384d52ea9648529c448bbb4af2
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Feb 8 20:59:30 2014 +0200

    flake8: New completion
---
 completions/Makefile.am         |  1 +
 completions/flake8              | 35 +++++++++++++++++++++++++++++++++++
 test/completion/flake8.exp      |  1 +
 test/lib/completions/flake8.exp | 18 ++++++++++++++++++
 4 files changed, 55 insertions(+)

diff --git a/completions/Makefile.am b/completions/Makefile.am
index ec06a9e..c70abc4 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -97,6 +97,7 @@ bashcomp_DATA = 2to3 \
 		filesnarf \
 		find \
 		find_member \
+		flake8 \
 		freebsd-update \
 		freeciv-gtk2 \
 		freeciv-server \
diff --git a/completions/flake8 b/completions/flake8
new file mode 100644
index 0000000..0bb3852
--- /dev/null
+++ b/completions/flake8
@@ -0,0 +1,35 @@
+# flake8 completion                                        -*- shell-script -*-
+
+_flake8()
+{
+    local cur prev words cword split
+    _init_completion -s || return
+
+    case $prev in
+        -h|--help|--version|--exclude|--filename|--select|--ignore|\
+        --max-line-length|--max-complexity|--builtins)
+            return
+            ;;
+        --format)
+            COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) )
+            return
+            ;;
+        --config)
+            _filedir
+            return
+            ;;
+    esac
+
+    $split && return
+
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+        [[ $COMPREPLY == *= ]] && compopt -o nospace
+        return
+    fi
+
+    _filedir py
+} &&
+complete -F _flake8 flake8
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/flake8.exp b/test/completion/flake8.exp
new file mode 100644
index 0000000..8050e8a
--- /dev/null
+++ b/test/completion/flake8.exp
@@ -0,0 +1 @@
+assert_source_completions flake8
diff --git a/test/lib/completions/flake8.exp b/test/lib/completions/flake8.exp
new file mode 100644
index 0000000..469f96e
--- /dev/null
+++ b/test/lib/completions/flake8.exp
@@ -0,0 +1,18 @@
+proc setup {} {
+    save_env
+}
+
+
+proc teardown {} {
+    assert_env_unmodified
+}
+
+
+setup
+
+
+assert_complete_any "flake8 "
+sync_after_int
+
+
+teardown

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list