zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: update entr completion
@ 2017-08-28 21:57 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2017-08-28 21:57 UTC (permalink / raw)
  To: Zsh workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-28 22:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 21:57 PATCH: update entr completion Oliver Kiddle

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).