1 ### vim:ft=zsh:foldmethod=marker
2 ## lists.debian.org message-id search backend for lookup
3 ## Copyright: 2009, Frank Terbeck <ft@bewatermyfriend.org>
5 LOOKUP_guard || return 1
6 [[ -n ${lookup_describe} ]] &&
7 printf '%s' 'search lists.debian.org by message-ids' &&
13 lookup_context="$(LOOKUP_context)"
15 LOOKUP_guard -fd LOOKUP_help_${backend} ||
16 function LOOKUP_help_${backend}() {
17 LOOKUP_guard || return 1
18 printf 'usage: %s [-1] <query>\n' ${backend}
19 printf ' -1 use the search'\''s first-hit option\n'
20 printf '\n Search Debian[1]'\''s Mailinglist Archive[2] my Message-ID: header.\n'
21 printf ' If you always want to use the -1 option, you may set the use-first-hit\n'
22 printf ' style in this context: %s\n' ${lookup_context}
23 printf '\nExamples:\n'
24 printf ' %% lookup %s 20090215095848.GA21661@schmehl.info\n' ${backend}
25 printf ' %% lookup %s -1 20090215095848.GA21661@schmehl.info\n' ${backend}
26 printf ' %% zstyle '\'':lookup:*:%s:*'\'' use-first-hit true\n' ${backend}
27 printf '\n[1] <http://www.debian.org>\n'
28 printf '[2] <http://lists.debian.org>\n'
30 LOOKUP_help && return 0
32 if [[ -n ${lookup_complete} ]] ; then
34 '-1[use /firsthit option]'
35 '*:message-id for l.d.o:true'
38 _arguments -s -w -A '-*' ${comp_args} && return 0
39 _message 'message-id for l.d.o'
47 lu_parseopts_args=( 1 bool )
48 LOOKUP_parseopts "$@" || return 1
49 [[ ${opts[-1]} == 'yes' ]] && end='/firsthit' || end='/links'
50 zstyle -t "${lookup_context}" use-first-hit && end='/firsthit'
53 LOOKUP_query_handler || return 1
54 if [[ -z ${QUERY} ]] ; then
60 LOOKUP_browser "http://lists.debian.org/msgid-search/${QUERY}${end}"