[devscripts] 03/06: Add bash_completion scripts for uscan & mk-origtargz

James McCoy jamessan at debian.org
Sun May 10 04:38:05 UTC 2015


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 176e7c229d1907508cda91faaeaa892cfc96a129
Author: James McCoy <jamessan at debian.org>
Date:   Sat May 9 22:22:52 2015 -0400

    Add bash_completion scripts for uscan & mk-origtargz
    
    Closes: #784394
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog                     |  2 ++
 scripts/mk-origtargz.bash_completion | 45 +++++++++++++++++++++++++++++
 scripts/uscan.bash_completion        | 55 ++++++++++++++++++++++++++++++++++++
 3 files changed, 102 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6bb1ea2..cfcdf77 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ devscripts (2.15.5) UNRELEASED; urgency=medium
     + Remove empty lines in debhelper-related files.  (Closes: #780667)
   * Install Perl modules into $Config{vendorlib} and remove the hacks in
     various scripts to make them see devscript's modules.
+  * Add bash completion scripts for uscan (thanks to Ben Finney) and
+    mk-origtargz.  (Closes: #784394)
 
  -- Cyril Brulebois <kibi at debian.org>  Tue, 28 Apr 2015 16:58:36 +0200
 
diff --git a/scripts/mk-origtargz.bash_completion b/scripts/mk-origtargz.bash_completion
new file mode 100644
index 0000000..4e6d499
--- /dev/null
+++ b/scripts/mk-origtargz.bash_completion
@@ -0,0 +1,45 @@
+# /etc/bash_completion.d/mk-origtargz
+# Programmable Bash command completion for the ‘mk-origtargz’ command.
+
+shopt -s progcomp
+
+_mk_origtargz_completion () {
+    COMPREPLY=()
+
+    local cur="${COMP_WORDS[COMP_CWORD]}"
+    local prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+    local opts="--help --verbose --version -v"
+    opts+=" --exclude-file --copyright-file"
+    opts+=" --package --directory -C"
+    opts+=" --copy --symlink --rename --repack --repack-suffix -S"
+    opts+=" --compression --copyright-file"
+
+    case "${prev}" in
+        --compression)
+            local formats=(gzip bzip2 lzma xz)
+            COMPREPLY=( $(compgen -W "${formats[*]}" -- ${cur}) )
+            ;;
+
+        --directory|-C)
+            COMPREPLY=( $(compgen -A directory -- ${cur}) )
+            ;;
+
+        --copyright-file)
+            COMPREPLY=( $(compgen -A file -- ${cur}) )
+            ;;
+
+        *)
+            COMPREPLY=($(compgen -W "${opts}" -- ${cur}))  
+            ;;
+    esac
+}
+
+complete -F _mk_origtargz_completion mk-origtargz
+
+
+# Local variables:
+# coding: utf-8
+# mode: shell-script
+# End:
+# vim: fileencoding=utf-8 filetype=sh :
diff --git a/scripts/uscan.bash_completion b/scripts/uscan.bash_completion
new file mode 100644
index 0000000..f102b34
--- /dev/null
+++ b/scripts/uscan.bash_completion
@@ -0,0 +1,55 @@
+# /etc/bash_completion.d/uscan
+# Programmable Bash command completion for the ‘uscan’ command.
+
+shopt -s progcomp
+
+_uscan_completion () {
+    COMPREPLY=()
+
+    local cur="${COMP_WORDS[COMP_CWORD]}"
+    local prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+    local opts="--help --verbose"
+    opts+=" --download --report --report-status"
+    opts+=" --no-download --force-download"
+    opts+=" --upstream-version --download-version --download-current-version"
+    opts+=" --check-dirname-level --check-dirname-regex"
+    opts+=" --no-pasv --pasv --timeout --user-agent --useragent"
+    opts+=" --no-verbose --verbose --debug --no-dehs --dehs"
+    opts+=" --no-conf --noconf --watchfile --destdir"
+    opts+=" --package --no-exclusion"
+    opts+=" --symlink --rename --repack --compression --copyright-file"
+
+    case "${prev}" in
+        --compression)
+            local formats=(gzip bzip2 lzma xz)
+            COMPREPLY=( $(compgen -W "${formats[*]}" -- ${cur}) )
+            ;;
+
+        --check-dirname-level)
+            local levels=(0 1 2)
+            COMPREPLY=( $(compgen -W "${levels[*]}" -- ${cur}) )
+            ;;
+
+        --watchfile)
+            COMPREPLY=( $(compgen -A file -- ${cur}) )
+            ;;
+
+        --copyright-file)
+            COMPREPLY=( $(compgen -A file -- ${cur}) )
+            ;;
+
+        *)
+            COMPREPLY=($(compgen -W "${opts}" -- ${cur}))  
+            ;;
+    esac
+}
+
+complete -F _uscan_completion uscan
+
+
+# Local variables:
+# coding: utf-8
+# mode: shell-script
+# End:
+# vim: fileencoding=utf-8 filetype=sh :

-- 
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