[devscripts] 01/01: Added bash compeltion for dscextract
Nicholas Bamber
periapt at moszumanska.debian.org
Tue Dec 1 10:53:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
periapt pushed a commit to branch master
in repository devscripts.
commit ad9350cec96b8e12315da0bee1be7490c3bb2fe7
Author: Nicholas Bamber <nicholas at periapt.co.uk>
Date: Tue Dec 1 10:53:03 2015 +0000
Added bash compeltion for dscextract
---
debian/changelog | 2 +-
scripts/dscextract.bash_completion | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 293341b..1017446 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,7 +20,7 @@ devscripts (2.15.10) UNRELEASED; urgency=medium
- Added listcachedbugs command to bts
- Split out bts bash completion handling into its own script
* Added custom bash completion support for debuild, checkbashisms,
- list-unreleased, dscverify and licensecheck
+ list-unreleased, dscverify, dscextract and licensecheck
* Updated custom bash completion handling for mk-origtargz
* licensecheck:
- Tweaked parselicense to capture 'and or' as well as
diff --git a/scripts/dscextract.bash_completion b/scripts/dscextract.bash_completion
new file mode 100644
index 0000000..ce439bf
--- /dev/null
+++ b/scripts/dscextract.bash_completion
@@ -0,0 +1,22 @@
+# Debian dscextract(1) completion -*- shell-script -*-
+# Copyright: 2015, Nicholas Bamber <nicholas at periapt.co.uk>
+_dscextract()
+{
+ local cur prev words cword _options
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-f' -- "$cur" ) )
+ elif [[ "$prev" == -f ]]; then
+ declare -a _compreply=( $( compgen -o filenames -G '*.dsc' ) )
+ COMPREPLY=( $( compgen -W "${_compreply[*]}" -- "$cur" ) )
+ elif [[ "$prev" == *.dsc ]]; then
+ declare -a _compreply=( $( tar tvf ${prev/.dsc/.debian.tar.*} | sed 's! \+! !g' | cut -d' ' -f6 ) )
+ COMPREPLY=( $( compgen -W "${_compreply[*]}" -- "$cur" ) )
+ else
+ declare -a _compreply=( $( compgen -W '-f' -o filenames -G '*.dsc' ) )
+ COMPREPLY=( $( compgen -W "${_compreply[*]}" -- "$cur" ) )
+ fi
+
+ return 0
+} && complete -F _dscextract dscextract
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list