X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_share_grml%2Fzsh%2Ffunctions%2FLookup%2FBackends%2FLOOKUP_be_filewatcher;fp=usr_share_grml%2Fzsh%2Ffunctions%2FLookup%2FBackends%2FLOOKUP_be_filewatcher;h=5eaa7775cf94fa893961289271cdd4c58aa29b85;hb=1ee27bd79f2b8eae519f6890bc43f5feca13a261;hp=0000000000000000000000000000000000000000;hpb=9ae0b0c0858f15dc7ec46fbd86660dafc3946695;p=grml-etc-core.git diff --git a/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_filewatcher b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_filewatcher new file mode 100644 index 0000000..5eaa777 --- /dev/null +++ b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_filewatcher @@ -0,0 +1,39 @@ +### vim:ft=zsh:foldmethod=marker +## filewatcher.com search backend for lookup +## Copyright: 2009, Frank Terbeck + +LOOKUP_guard || return 1 +[[ -n ${lookup_describe} ]] && + printf '%s' 'search filewatcher.com' && + return 0 + +local -a comp_args + +LOOKUP_guard -fd LOOKUP_help_${backend} || +function LOOKUP_help_${backend}() { + LOOKUP_guard || return 1 + printf 'usage: %s \n' ${backend} + printf '\n Use filewatcher.com to search FTP server contents.\n' + printf '\nExamples:\n' + printf ' %% lookup %s '\''zsh*.tar.gz'\''\n' ${backend} + printf ' %% lookup %s '\''*.jpg'\''\n\n' ${backend} +} +LOOKUP_help && return 0 + +if [[ -n ${lookup_complete} ]] ; then + _message 'filewatcher search string' + return 0 +fi + +local -x QUERY + +QUERY="$*" +LOOKUP_query_handler || return 1 +if [[ -z ${QUERY} ]] ; then + LOOKUP_help -f + return 1 +fi + +LOOKUP_encode -s -q +LOOKUP_browser "http://www.filewatcher.com/_/?q=${QUERY}" +return $?