Zsh Mailing List Archive
Messages sorted by:
Re: [PATCH v2] Correct completion of 'tmux new <TAB>'.
- X-seq: zsh-workers 41448
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH v2] Correct completion of 'tmux new <TAB>'.
- Date: Sun, 23 Jul 2017 09:48:05 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1500796086; bh=yFjKvsLY/Mz0wngC4fTLz4E/Tis2y0rFdiMUncYsCAA=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=sxIu1zAO1rGtKmG27ytLXS6pd7AFhbOLASZ7hB9L6ChuLcXFGhcGpuV9f40r+hlGiT0j/HAEMQ1RX0KVJZbbEofB9op+aHcjZEmVfzrrXOjAqLzKywrmEDMInub0/M9PDwMODyldV1dk+aSJqRLVsWmrC9dUUGAymapYj7MEkqR+lQq2u91XNhPITtrskwg9pursva+T6cuZJ1+ui+e1FyfpKFMkXe1s6kX/EfjmmnG1SMDSMbao1RZhqIC7oDj8FwcVXO6LbZGH/fz6R5+ttkoeoo5i67VXpbmseS/NZO6YfixvfvNLvAXMt5qUo8zMriv4YbHWRfBV8opKFmfq4Q==
- In-reply-to: <1500659163.916799.1048510048.293AC92C@webmail.messagingengine.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <email@example.com> <CAH+w=7ZNhO+C33_o21ZiuDiu_c2zf4rMHSh6PdgGtCXWJ7HPpw@mail.gmail.com> <1500659163.916799.1048510048.293AC92C@webmail.messagingengine.com>
Daniel Shahaf wrote:
> > I believe I understand what this is doing, but "if there is a single
> > argument" isn't entirely clear. It does NOT mean "if there is a
> > single positional parameter in the call to this function" (which is
> > how I first read it, before I actually looked at the function
> > definition); rather it means "if there is more than one word in
> > argument position on the command line".
> I'll change to your wording before committing. Thanks for the
> blind review!
For the documentation wouldn't it perhaps be better to describe the
basic use first. i.e. it is for commands that are ambivalent about
taking either a quoted command-string or a command and series of
Your implementation will favour the _cmdstring variant in the sense that
completing a command-name will give you a quoted space as the suffix.
I think it would be preferable to check if the first and only argument
contains any spaces before switching to the _cmdstring variant and so
avoid unnecessary quoting.
We might also want to consider the many cases where we use the following
'(-):command:_command_names -e' \
This also appears in if .. then .. else form in _strace and _socket.
It might be good to cover this with a single helper - _cmdrest perhaps
- but note that _precommand is not for this purpose: it completes
functions and aliases. I'm not convinced that _precommand should be
documented in this section at all. It wasn't really meant as a helper
but as a as a catch-all handler for the zsh precommand modifiers. Note
that it is in Zsh/Command.
I see a precommands array was added around 2009 in _precommand to
facilitate _calendar's check to see if it was run with command. What
do we want to include in this. It might be useful to collect all the
wrapper commands and not just zsh precommand modifiers. It is somewhat
similar to the _comp_priv_prefix that we added more recently.
Messages sorted by: