tools: add playbook driver switch
[barry/progweb.git] / zsh / _btool
blob15db93773cff4552b889ac8b7c076f79213cdd3b
1 #compdef btool
3 local _btool_options
5 local state
8 _btool_options=(
9         '-h[Show the most relevant command line options]' \
10         '-B=[Specify which USB bus to search on]:USB bus:' \
11         '-N=[Specify which system device, using system specific string]:Device:' \
12         '-c=[Convert address book database to LDIF format, using the specified base DN]:LDIF format:' \
13         '-C=[LDIF attribute name to use when building the FQDN]:LDIF attribute:' \
14         '-a=[Clear database FROM device]:Database:' \
15         '-b=[Filename to save or load a Barry Backup to]:archive:->archive' \
16         '-d=[Load database FROM device and dump to screen]:Database:' \
17         '-e=[Override endpoint pair detection]:Endpoint:' \
18         '-f=[Filename to save or load handheld data to/from]:Filename:_files' \
19         '-i=[International charset for string conversions]:International charset:->iconv' \
20         '-I[Sort records before output]' \
21         '-l[List devices]' \
22         '-L[List Contact field names]' \
23         '-m[Map LDIF name to Contact field / Unmap LDIF name]' \
24         '-M[List current LDIF mapping]' \
25         '-n[Use null parser on all databases]' \
26         '-p=[PIN of device to talk with]:PIN:' \
27         '-P=[Simplistic method to specify device password]:Device password:' \
28         '-s=[Save database TO device from data loaded from -f file]:Database:' \
29         '-S[Show list of supported database parsers]' \
30         '-t[Show database database table]' \
31         '-T=[Show record state table for given database]:Database:' \
32         '-v[Dump protocol data during operation]' \
33         '-V[Dump records using MIME vformats where possible]' \
34         '-X[Reset device]' \
35         '-z[Use non-threaded sockets]' \
36         '-Z[Use threaded socket router (default)]'
40 _btool_iconv() {
41         local result
43         result=( ${${${(f)"$(_call_program codesets iconv --list)"}## #}%//} )
45         compadd -a "$@" - result
49 _arguments -C -s "$_btool_options[@]" && return 0
52 case $state in
53         iconv)
54                 _btool_iconv && return 0
55         ;;
57         archive)
58                 _files -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)' && return 0
59         ;;
60 esac