| 1 |
function _complete_key_value_list |
| 2 |
if test (count $argv) -eq 0 |
| 3 |
printf '%s\t%s\t%s\n' \ |
| 4 |
'async' 'set async mode' '' \ |
| 5 |
'animal=' 'select an animal' '' \ |
| 6 |
'optional=?' 'optional argument' '' \ |
| 7 |
'special' "special chars: []'\"\$`\\" '' \ |
| 8 |
'exclusive' 'disable options' 'async animal' \ |
| 9 |
'*repeatable' 'repeatable option' '' |
| 10 |
else |
| 11 |
switch "$argv[1]" |
| 12 |
case animal optional |
| 13 |
printf '%s\t%s\n' \ |
| 14 |
'cat' 'a cat' \ |
| 15 |
'dog' 'a dog' \ |
| 16 |
'horse' 'a horse' \ |
| 17 |
'special' ":[]'\"\$`\\" |
| 18 |
end |
| 19 |
end |
| 20 |
end |