1 ### vim:ft=zsh:foldmethod=marker
2 ## bts.grml.org backend for lookup
3 ## Copyright: 2010, Frank Terbeck <ft@bewatermyfriend.org>
5 LOOKUP_guard || return 1
6 [[ -n ${lookup_describe} ]] &&
7 printf '%s' 'bts.grml.org bug lookups' &&
10 LOOKUP_guard -fd LOOKUP_help_${backend} ||
11 function LOOKUP_help_${backend}() {
12 LOOKUP_guard || return 1
13 printf 'usage: %s <bug-id>\n' ${backend}
14 printf '\n Query grml[1]'\''s Bug Tracking System[2].\n'
15 printf '\n This looks up bugs by bug id in grml'\''s BTS. In this mode, all\n'
16 printf ' non-digit characters are automatically stripped off of the query.\n'
17 printf '\nExamples:\n'
18 printf ' %% lookup %s 123\n' ${backend}
19 printf ' %% lookup %s "#123"\n' ${backend}
20 printf '\n[1] <http://grml.org>\n'
21 printf '[2] <http://bts.grml.org>\n'
23 LOOKUP_help && return 0
28 if [[ -n ${lookup_complete} ]] ; then
29 comp_args=( '*:grml bts query:true' )
31 _arguments -s -w -A '-*' ${comp_args} && return 0
32 _message 'grml bts query'
37 LOOKUP_query_handler || return 1
38 QUERY="${QUERY//[^0-9]/}"
39 if [[ -z ${QUERY} ]] ; then
45 LOOKUP_browser "http://bts.grml.org/grml/issue${QUERY}"