My zsh script takes following arguments:
./script --connect server --foo 3 --bar 5 name --foo and --bar take integers, name is the only non-option argument, and --connect should complete from predefinded list of servers. I am stuck at the --connect part, where I tried to define server list.
_arguments -S : \ '--foo' \ '--bar' \ '--connect' \ '*:server:->servers' _servers() { local -a server_list server_list=( 'server1' 'server2' ) _describe -t server-names "server name" server_list } it will offer the options, when I type -<TAB>, but it does not offer me the servers after --connect. Also, I don't know how to incorporate the name argument, which is non-option argument.
And I also need to specify that --foo and --bar need an integer