diff --git a/ChangeLog b/ChangeLog index 9de7d953b..1907393be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-06-07 Oliver Kiddle + + * 43943: Completion/Unix/Command/_samba: update with long options + 2018-06-06 Peter Stephenson * Eitan: 42938: Src/Modules/mathfunc.c: name argument to diff --git a/Completion/Unix/Command/_samba b/Completion/Unix/Command/_samba index faad69ba4..9a2fea9d6 100644 --- a/Completion/Unix/Command/_samba +++ b/Completion/Unix/Command/_samba @@ -1,93 +1,112 @@ #compdef smbcontrol smbclient nmblookup smbstatus -local expl msgs args +local curcontext="$curcontext" ret=1 +local -a state line expl msgs args ign + +(( CURRENT == 2 )) || ign='!' +args=( + '(-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' + "${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 smbcontrol) - case $CURRENT in - 3) - msgs=( debug ping profile debuglevel profilelevel ) - case $words[CURRENT-1] in - nmbd) msgs=( $msgs force-election ) ;; - smbd) msgs=( $msgs printer-notify ) ;; - -i) return 1 ;; - esac - _wanted message-type expl 'message types' compadd -a msgs + _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)