Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: update entr completion
- X-seq: zsh-workers 41616
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: update entr completion
- Date: Mon, 28 Aug 2017 23:57:47 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1503957475; bh=Sq+Gu0QVIM8kjY2sC7xjm3tP1EMlHQ6pY0ostPeToyk=; h=From:To:Subject:Date:From:Subject; b=f3rbwRmweIKQWmucz04lh/uVIqtw6xDK6bXnar898ucrE3l9NqUlztqpokGFRRwUNpg4BUKyXdOdD634BI+Qvz5vpFnOt1ChNIdHAsoIrG75KHnJSlm/47LwoYiN0pozTI2V0kY9pas7fPolLjCtOKBE2qpwjiTUqF8+mPLdBxpvvcnbQESX4bCc6Up6LVSCIXWHLO9i2O+GP/tixt6RafcxUBRWpkQ+aIC0P+59/yGYIEhwV264gW4zBxWhfh4uazv+YLSriaMTxzB9GqFGRZHM1SpU/F6KD7S+soEAPwFtGcbO0+c8K6V+6Q+6YlS8NkYv5ebqZFmHy/EOpSqJiw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author