From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10004 invoked by alias); 18 Sep 2014 16:36:54 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19105 Received: (qmail 13206 invoked from network); 18 Sep 2014 16:36:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140918093602.ZM7963@torch.brasslantern.com> Date: Thu, 18 Sep 2014 09:36:02 -0700 In-reply-to: <541AA918.8060503@thregr.org> Comments: In reply to "Yuri D'Elia" "Re: rsync --progress stops completion" (Sep 18, 11:42am) References: <2002755.9ryFYYVtTN@note> <5418786F.8030001@thregr.org> <140916175124.ZM5742@torch.brasslantern.com> <54194198.2010607@thregr.org> <140917085133.ZM6725@torch.brasslantern.com> <541AA918.8060503@thregr.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: rsync --progress stops completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 18, 11:42am, Yuri D'Elia wrote: } Subject: Re: rsync --progress stops completion } } On 09/17/2014 05:51 PM, Bart Schaefer wrote: } > Sure, just add _files to the end of your completer zstyle, e.g.: } > } > zstyle ':completion:*' completer _oldlist _expand _complete _files } } That would be the heavy handed approach, however I think it would be a } better approach (in general) to ignore unknown command-line arguments Two points: - this doesn't help in the example in question because the command-line argument isn't unknown; it's both known and specifically excluded. - I don't follow how this is "heavy handed"; when the context parse goes wrong (or intentionally fails), the completion has to fall back on *something*. What would you like that something to be, and how would you like to tell the completion system about it, if not in the completer zstyle? } Some sort of visual clue that the completion stopped because of an error } could also be helpful maybe? This might help: _oopsie() { _message "No completions" } zstyle ':completion:*:messages' format %S%d%s zstyle ':completion:*' completer _oldlist _expand _complete _oopsie We could also consider this (I'm not sure what unexpected side-effects there might be, particularly for completers that try multiple calls to _arguments): diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index d70c442..e9586e6 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -570,5 +570,6 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then [[ nm -ne "$compstate[nmatches]" ]] else + _message "$service cannot parse command line" return 1 fi