zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: update entr completion
Date: Mon, 28 Aug 2017 23:57:47 +0200	[thread overview]
Message-ID: <6929.1503957467@thecus.kiddle.eu> (raw)

entr 3.8 adds a -s option.

Oliver

diff --git a/Completion/Unix/Command/_entr b/Completion/Unix/Command/_entr
index 8a830ae71..a8d43fc5e 100644
--- a/Completion/Unix/Command/_entr
+++ b/Completion/Unix/Command/_entr
@@ -1,9 +1,23 @@
 #compdef entr
 
+local curcontext="$curcontext" state state_descr line ret=1
+typeset -A opt_args
+
 _arguments -s -S \
   '-c[execute clear before invoking utility]' \
   '-d[track directories and exit if a new file is added]' \
   '-p[postpone first execution of the utility]' \
   '-r[reload a persistent child process]' \
-  '(-):command name:_command_names -e' \
-  '*::arguments:_normal'
+  '(*)-s[evaluate the first argument using interpreter specified by $SHELL]' \
+  '(-): :->command' \
+  '*::arguments:_normal' && ret=0
+
+if [[ -n $state ]]; then
+  if (( $+opt_args[-s] )); then
+    _cmdstring && ret=0
+  else
+    _command_names -e && ret=0
+  fi
+fi
+
+return ret


                 reply	other threads:[~2017-08-28 22:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6929.1503957467@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).