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

Re: Check if option given in short notation (e.g. -9) is set



On Tue, 26 Jan 2016 14:33:29 +0100
Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:

> Hello
> [[ -o "-9" ]] doesn't work. Is there any way to check option given in
> such format, besides holding an associative array that would assign
> long name to each short name?

I think

[[ -n ${-[(r)9]} ]]

is reliable.  It should reflect all single-letter options, so if it
doesn't that's a bug.

pws



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