File: lbdbq-detect-lbdbq.diff

package info (click to toggle)
vim-scripts 20130814
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,608 kB
  • ctags: 2,511
  • sloc: perl: 452; xml: 95; makefile: 25
file content (19 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## lbdbq-detect-lbdbq.diff by Stefano Zacchiroli <zack@debian.org>
##
## detect (the absence of) the lbdbq executable

Index: vim-scripts/plugin/lbdbq.vim
===================================================================
--- vim-scripts.orig/plugin/lbdbq.vim
+++ vim-scripts/plugin/lbdbq.vim
@@ -14,6 +14,10 @@
 " queries lbdb with a query string and return a list of pairs:
 " [['full name', 'email'], ['full name', 'email'], ...]
 function! LbdbQuery(qstring)
+  if !executable("lbdbq")
+    echoerr "Cannot find 'lbdbq' executable, please install it (usually, it comes with the 'lbdb' package)"
+    return []
+  endif
   let output = system("lbdbq '" . a:qstring . "'")
   let results = []
   for line in split(output, "\n")[1:] " skip first line (lbdbq summary)