Hi, thanks for the suggestions. On 27.10.2016 03:30, Daniel Shahaf wrote: > Something like this: > . > _id_ranges() { if compset -P '*..'; then _ids; else _ids -S ..; fi } > . > where _ids() is a function that adds "1" "2" "3" as completions. > > There should be examples of this in the revision ranges handling in > _git/_hg/_subversion. > added the id ranges similar to your suggestion and checking _git. >> [snap] > > This looks like it would be better written with _alternative: > > alts=() > [[ -n "${ID_range_commands[(r)$words[2]]}" ]] && alts+=( 'id-ranges:id ranges:_id-ranges' ) > [[ -n "${package_commands[(r)$words[2]]}" ]] && alts+=( 'packages:packages:...' ) > ⋮ > (( ${+alts[1]} )) && _alternative "$alts[@]" > > To see the difference, set the «group-name» style to «''» (and > optionally the «format» style to something with «%d» in it). You can > see this in «ssh » too (compare with/without those two styles). also i'm using _alternative by now, but i'll bring it closer to your suggestion soonish. Cheers, Paul