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

Tobias Grimm tiber-guest at moszumanska.debian.org
Sun Feb 8 17:32:32 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 f36b7f2a2118cfdc67eca63bb89bafce49b14c97
Author: etobi <git at e-tobi.net>
Date:   Sun Feb 8 15:30:36 2015 +0100

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

diff --git a/debian/changelog b/debian/changelog
index b34db5e..3a5b202 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ vdr (2.1.8-1~etobi1) UNRELEASED; urgency=medium
 
   * New upstream release
   * Dropped opt-22-x_edit_marks.patch
+  * Added bash completion for svdrpesend (taken from yaVDR / Lars Hanisch)
 
  -- Tobias Grimm <etobi at debian.org>  Sat, 07 Feb 2015 11:15:37 +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.bash-completion b/debian/vdr.bash-completion
new file mode 100644
index 0000000..1cda107
--- /dev/null
+++ b/debian/vdr.bash-completion
@@ -0,0 +1 @@
+debian/bash-completion/svdrpsend
diff --git a/debian/vdr.install b/debian/vdr.install
index 93d1ddf..0a879b9 100644
--- a/debian/vdr.install
+++ b/debian/vdr.install
@@ -21,6 +21,8 @@ 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/vdr.groups                       etc/vdr/
 debian/R90.custom                       etc/vdr/recording-hooks/
 debian/S90.custom                       etc/vdr/shutdown-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