#compdef smbcontrol smbclient nmblookup smbstatus local curcontext="$curcontext" ret=1 local -a state line expl msgs args ign (( CURRENT == 2 )) || ign='!' args=( '--debug-stdout[send debug output to stdout]' '(-d --debuglevel)'{-d+,--debuglevel=}'[set debug level]:debug level (1..10) [1]' '(-s --configfile)'{-s+,--configfile=}'[specify alternate smb.conf file]:config file:_files' '(-l --log-basename)'{-l+,--log-basename=}'[specify base name for log files]:base name:_files' '*--option=[set smb.conf option from command line]:option=value' '--leak-report[enable talloc leak reporting on exit]' '--leak-report-full[enable full talloc leak reporting on exit]' "${ign}(1 2 3 -)"{-\?,--help}'[display usage information]' "${ign}(1 2 3 -)--usage[display brief usage information]" "${ign}(1 2 3 - *)"{-V,--version}'[display version information]' ) case $service in smbclient|nmblookup) args+=( '(2 -R --name-resolve)'{-R+,--name-resolve=}'[specify name resolution order]:name resolution order:_values -s " " "name resolution order" lmhosts host wins bcast' '(-m --max-protocol)'{-m+,--max-protocol=}'[set the max protocol level]:level' '(2 -O --socket-options)'{-O+,--socket-options=}'[specify socket options]:socket options' '(2)--netbios-scope=[specify NetBIOS scope]:scope' '(2 -W --workgroup)'{-W+,--workgroup=}'[specify workgroup name]:workgroup name' '--realm=[set the realm name]:realm' ) ;| smbcontrol) _arguments -C -S $args \ '(-t --timeout)'{-t+,--timeout=}'[set timeout]:timeout (seconds)' \ ':destination:(all nmbd smbd winbindd)' \ ':message type:->message-types' \ ':parameter:->parameters' && ret=0 case $state in message-types) msgs=( ${${${${${(f)"$(_call_program message-types smbcontrol -\? 2>&1)"}[(r)