On 2024-01-28 22:10, Mikael Magnusson wrote: > On 1/28/24, Celeste Liu wrote: >> Hi, >> >> Recently I write zsh completion file for a serial port tool named tio. It >> has >> a feature to redirect I/O to a socket, so there is a argument --socket which >> >> accepts something like unix:/path/to/socket or inet:1234. But I don't know >> how >> to write this function. Could someone help me? Thanks. > > You probably want to use something like > if compset -P unix:; then > _files -g '*(=)' > elif compset -P inet:; then > ...?... > fi > It works. Thank you! 73 Celeste Liu