[vdr] 05/21: Added bash completion for svdrpesend (taken from yaVDR / Lars Hanisch)

Tobias Grimm tiber-guest at moszumanska.debian.org
Wed Mar 25 00:19:23 UTC 2015


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

tiber-guest pushed a commit to branch e-tobi
in repository vdr.

commit 34ebabd5c384499bb2a8a608ed42047eb6160272
Author: etobi <git at e-tobi.net>
Date:   Sun Mar 22 12:53:11 2015 +0100

    Added bash completion for svdrpesend (taken from yaVDR / Lars Hanisch)
---
 debian/changelog   |  1 +
 debian/svdrpsend   | 35 +++++++++++++++++++++++++++++++++++
 debian/vdr.install |  1 +
 3 files changed, 37 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index b378739..80f70da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,7 @@ vdr (2.2.0-1) UNRELEASED; urgency=medium
   * Removed the VDR_CHARSET_OVERRIDE from /etc/default/vdr - replaced with the
    --chartab command line argument
   * Removed dvb-modules reloading code (Closes: #512362)
+  * Added bash completion for svdrpesend (taken from yaVDR / Lars Hanisch)
 
  -- Tobias Grimm <etobi at debian.org>  Sat, 07 Mar 2015 13:02:02 +0100
 
diff --git a/debian/svdrpsend b/debian/svdrpsend
new file mode 100644
index 0000000..c34dadf
--- /dev/null
+++ b/debian/svdrpsend
@@ -0,0 +1,35 @@
+
+have svdrpsend &&
+_svdrpsend ()
+{
+  local cur prev
+
+  _get_comp_words_by_ref cur prev
+
+  COMPREPLY=()
+
+  if [[ ($COMP_CWORD -eq 1) || ("${prev^^}" == "HELP") ]]; then
+
+    cmds="CHAN CLRE DELC DELR DELT EDIT GRAB HELP HITK LSTC LSTE LSTR LSTT MESG MODC MODT MOVC MOVR NEWC NEWT NEXT PLAY PLUG PUTE REMO SCAN STAT UPDT UPDR VOLU"
+    COMPREPLY=( $( compgen -W "$cmds" | grep -i "^$cur" ) )
+
+  else
+
+    case "${prev}" in
+
+      chan|CHAN)
+        COMPREPLY=( $( compgen -W "+ -" $cur ) )
+        ;;
+
+      plug|PLUG)
+        apiversion=`eval "/usr/bin/vdr -V -L/usr/bin/vdr 2>/dev/null | sed 's/.*(.*\/\(.*\)).*/\1/'"`
+        plugins=`eval "find /usr/lib/vdr/plugins -name 'libvdr-*.so.${apiversion}' -printf '%f\n' | sed -e 's/libvdr-\(.*\)\.so\.${apiversion}/\1/'"`
+        COMPREPLY=( $( compgen -W "$plugins" | grep -i "^$cur" ) )
+        ;;
+
+    esac
+
+  fi
+}
+
+[ "$have" ] && complete -F _svdrpsend -o filenames svdrpsend
diff --git a/debian/vdr.install b/debian/vdr.install
index 25a6a4e..b7b64d8 100644
--- a/debian/vdr.install
+++ b/debian/vdr.install
@@ -19,6 +19,7 @@ debian/vdr-recordingaction              usr/lib/vdr/
 debian/vdr-shutdown                     usr/lib/vdr/
 debian/vdr-shutdown.wrapper             usr/lib/vdr/
 
+debian/svdrpsend                        etc/bash_completion.d/
 debian/00-vdr.conf                      etc/vdr/conf.d/
 debian/vdr.groups                       etc/vdr/
 debian/R90.custom                       etc/vdr/recording-hooks/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr.git



More information about the pkg-vdr-dvb-changes mailing list