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
- X-seq: zsh-users 21178
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Check if option given in short notation (e.g. -9) is set
- Date: Tue, 26 Jan 2016 13:43:58 +0000
- In-reply-to: <CAKc7PVBs3Vvr1UuYWQRkGY8P1CQ6JDCxvukO7zdndBj=HOLs-A@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAKc7PVBs3Vvr1UuYWQRkGY8P1CQ6JDCxvukO7zdndBj=HOLs-A@mail.gmail.com>
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