[Python-modules-commits] r6667 - in packages/pastescript/trunk/debian (4 files)

piotr at users.alioth.debian.org piotr at users.alioth.debian.org
Thu Oct 9 21:40:36 UTC 2008


    Date: Thursday, October 9, 2008 @ 21:40:36
  Author: piotr
Revision: 6667

Add bash completion for paster

Added:
  packages/pastescript/trunk/debian/paster.bash_completion
Modified:
  packages/pastescript/trunk/debian/changelog
  packages/pastescript/trunk/debian/dirs
  packages/pastescript/trunk/debian/rules

Modified: packages/pastescript/trunk/debian/changelog
===================================================================
--- packages/pastescript/trunk/debian/changelog	2008-10-09 20:58:15 UTC (rev 6666)
+++ packages/pastescript/trunk/debian/changelog	2008-10-09 21:40:36 UTC (rev 6667)
@@ -1,3 +1,9 @@
+pastescript (1.6.3-2) UNRELEASED; urgency=low
+
+  * Add bash completion for paster
+
+ -- Piotr Ożarowski <piotr at debian.org>  Thu, 09 Oct 2008 23:36:34 +0200
+
 pastescript (1.6.3-1) unstable; urgency=low
 
   * New upstream release

Modified: packages/pastescript/trunk/debian/dirs
===================================================================
--- packages/pastescript/trunk/debian/dirs	2008-10-09 20:58:15 UTC (rev 6666)
+++ packages/pastescript/trunk/debian/dirs	2008-10-09 21:40:36 UTC (rev 6667)
@@ -2,3 +2,4 @@
 /usr/share/paster_templates
 /usr/share/doc/python-pastescript/docs
 /usr/share/lintian/overrides
+/etc/bash_completion.d/

Added: packages/pastescript/trunk/debian/paster.bash_completion
===================================================================
--- packages/pastescript/trunk/debian/paster.bash_completion	                        (rev 0)
+++ packages/pastescript/trunk/debian/paster.bash_completion	2008-10-09 21:40:36 UTC (rev 6667)
@@ -0,0 +1,37 @@
+# paster(1) completion
+# Copyright 2008 Piotr Ożarowski <piotr at debian.org>
+
+# This script can be distributed under the same license as the
+# pastescript or bash packages.
+
+have paster &&
+_paster()
+{
+    local cur prev paster_options commands
+    
+    COMPREPLY=()
+    cur=${COMP_WORDS[COMP_CWORD]}
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+    paster_options='-h --help -v --version --plugin'
+    commands="$(python -c 'from paste.script.command import get_commands; print " ".join(get_commands().keys())')"
+
+
+    case ${COMP_WORDS[1]} in
+	-h|--help|-v|--version)
+	    COMPREPLY=()
+	    ;;
+	help)
+	    COMPREPLY=( $( compgen -W "$commands" | grep "^$cur" ) )
+	    ;;
+	serve)
+	    COMPREPLY=( $( compgen -G "${cur}*.ini" -W "$(paster help serve | grep -o '\-\{1,2\}[a-zA-Z][-a-zA-Z]*')" | grep "^$cur" ) )
+	    ;;
+	*)
+	    COMPREPLY=( $( compgen -W "$paster_options $commands" | grep "^$cur" ) )
+	    ;;
+    esac
+
+    return 0
+
+}
+[ "$have" ] && complete -F _paster paster

Modified: packages/pastescript/trunk/debian/rules
===================================================================
--- packages/pastescript/trunk/debian/rules	2008-10-09 20:58:15 UTC (rev 6666)
+++ packages/pastescript/trunk/debian/rules	2008-10-09 21:40:36 UTC (rev 6667)
@@ -57,6 +57,7 @@
 	dh_link usr/share/doc/python-pastescript/docs /usr/share/doc/python-paste/docs/script
 	dh_installman -i 
 	dh_install scripts/paster /usr/bin/
+	install -m 644 debian/paster.bash_completion $(PKGDIR)/etc/bash_completion.d/paster
 	dh_pysupport -i -X/usr/bin/paster
 	dh_compress -i -X.py
 	dh_fixperms -i
@@ -69,4 +70,4 @@
 
 binary: binary-indep binary-arch
 
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install




More information about the Python-modules-commits mailing list