Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: compadd --



On Oct 25,  4:33pm, foudfou wrote:
}
} It looks like '-' and '--' don't have the same effect in compadd.
} 
} For example, the following completion function produces "_systemctl_test:compadd:2: bad option: -.":
} 
} _systemctl_test()
} {
}    compadd -- -.mount boot.mount
} }
} 
} Whereas it works well with '-'.

Hmm.  This is a relatively new problem; here's zsh 4.2.0:

schaefer[505] compdef _systemctl_test foo
schaefer[506] foo <TAB>
-.mount     boot.mount

Here's 4.3.12-dev-1 1.5473:

torch% foo  
_systemctl_test:compadd:2: bad option: -.

The problem seems to be that the generic option parser has already
removed the "--" option before bin_compadd is even called, even though
the declaration

BUILTIN("compadd", 0, bin_compadd, 0, -1, 0, NULL, NULL)

says that compadd is going to do all its own option parsing.

This probably affects some other builtins as well.



Messages sorted by: Reverse Date, Date, Thread, Author