[game-data-packager] 04/39: add bash completion

Simon McVittie smcv at debian.org
Sun Jan 11 01:52:21 UTC 2015


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

smcv pushed a commit to branch master
in repository game-data-packager.

commit 493717eefd33e1ba0647f302b52a596668ffdc32
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Tue Jan 6 11:15:16 2015 +0100

    add bash completion
---
 debian/control                            |  1 +
 debian/game-data-packager.bash-completion | 14 ++++++++++++++
 debian/rules                              |  2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index a478403..7a332fe 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends:
  pyflakes,
  python3,
  python3-yaml,
+ bash-completion,
 Standards-Version: 3.9.6
 Vcs-Git: git://anonscm.debian.org/pkg-games/game-data-packager
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-games/game-data-packager.git
diff --git a/debian/game-data-packager.bash-completion b/debian/game-data-packager.bash-completion
new file mode 100644
index 0000000..fad6e0d
--- /dev/null
+++ b/debian/game-data-packager.bash-completion
@@ -0,0 +1,14 @@
+_game_data_packager()
+{
+    if [ $COMP_CWORD -eq 1 ]
+    then
+      local cur supported
+      cur=${COMP_WORDS[COMP_CWORD]}
+      supported=$(ls -1 /usr/share/games/game-data-packager/supported/)
+      COMPREPLY=( $( compgen -W "$supported" -- $cur ) )
+    else
+      COMPREPLY=()
+    fi
+}
+
+complete -o default -F _game_data_packager game-data-packager
diff --git a/debian/rules b/debian/rules
index 37279c3..0b611bf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,7 +5,7 @@
 export DH_OPTIONS
 
 %:
-	dh $@ --with python3
+	dh $@ --with python3,bash-completion
 
 VERSION := $(shell dpkg-parsechangelog | grep ^Version | cut -d' ' -f2-)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list