1#compdef wgetpaste 2 3# vim: set et sw=2 sts=2 ts=2 ft=zsh : 4# ZSH completion for `wgetpaste`, http://wgetpaste.zlin.dk 5# Written by Ingmar Vanhassel <ingmar@exherbo.org> 6 7 8(( ${+functions[_wgetpaste_services]} )) || 9_wgetpaste_services() 10{ 11 local -a _services 12 _services=( $(_call_program service wgetpaste --list-services --completions --verbose 2>/dev/null) ) 13 _describe -t service 'what service should be used' \ 14 _services 15} 16 17(( ${+functions[_wgetpaste_languages]} )) || 18_wgetpaste_languages() 19{ 20 local -a _languages 21 _languages=( ${(f)"$(_call_program language wgetpaste --list-languages --completions 2>/dev/null)"} ) 22 _describe -t language 'what language to post as' \ 23 _languages 24} 25 26(( ${+functions[_wgetpaste_expiration]} )) || 27_wgetpaste_expiration() 28{ 29 local -a _expiration 30 _expiration=( ${(f)"$(_call_program expiration wgetpaste --list-expiration --completions 2>/dev/null)"} ) 31 _describe -t expiration 'when should your paste expire' \ 32 _expiration 33} 34 35_arguments -s : \ 36 '(--language -l)'{--language,-l}'[set language]:language:_wgetpaste_languages' \ 37 '(--description -d)'{--description,-d}'[set description]:description: ' \ 38 '(--nick -n)'{--nick,-n}'[set nick]:nick:_users' \ 39 '(--service -s)'{--service,-s}'[set service to use]:service:_wgetpaste_services' \ 40 '(--expiration -e)'{--expiration,-e}'[set when your paste should expire]:expiration:_wgetpaste_expiration' \ 41 '(--list-services -S)'{--list-services,-S}'[list supported pastebin services]' \ 42 '(--list-languages -L)'{--list-languages,-L}'[list languages supported by the specified service]' \ 43 '(--list-expiration -E)'{--list-expiration,-E}'[list expiration setting supported by the specified service]' \ 44 '(--tinyurl -u)'{--tinyurl,-u}'[convert input url to tinyurl]:url:_urls' \ 45 '(--command -c)'{--command,-c}'[paste a command and its output]:command:_command' \ 46 '(--info -i)'{--info,-i}'[append the output of `emerge --info`]' \ 47 '(--info-only -I)'{--info-only,-I}'[paste the output of `emerge --info` only]' \ 48 '(--xcut -x)'{--xcut,-x}'[read input from clipboard]' \ 49 '(--xpaste -X)'{--xpaste,-X}'[write resulting url to the X primary selection buffer]' \ 50 '(--xclippaste -C)'{--xclippaste,-C}'[write resulting url to the X clipboard selection buffer]' \ 51 '(--raw -r)'{--raw,-r}'[show url for the raw paste]' \ 52 '(--tee -t)'{--tee,-t}'[use tee to show what is being pasted]' \ 53 '(--verbose -v)'{--verbose,-v}'[show wget stderr output if no url is received]' \ 54 '--debug[be very verbose]' \ 55 '(--help -h)'{--help,-h}'[show help and exit]' \ 56 '(--ignore-configs,-g)'{--ignore-configs,-g}'[ignore /etc/wgetpaste.conf, ~/.wgetpaste.conf etc]' \ 57 '--version[show version information and exit]' \ 58 '*:file:_files' && 59 return 60 61