zsh-workers
 help / Atom feed
* [PATCH] Completion: Break out _exec, _setsid
@ 2018-12-31  2:13 dana
  0 siblings, 0 replies; 1+ messages in thread
From: dana @ 2018-12-31  2:13 UTC (permalink / raw)
  To: Zsh workers

This breaks exec and setsid out of _precommand into their own functions.

I put _setsid under Linux with the rest of the util-linux stuff, though it
does work on other platforms (it's in Homebrew for example), so maybe that's
arguable

dana


diff --git a/Completion/Linux/Command/_setsid b/Completion/Linux/Command/_setsid
new file mode 100644
index 000000000..a8107e582
--- /dev/null
+++ b/Completion/Linux/Command/_setsid
@@ -0,0 +1,12 @@
+#compdef setsid
+
+[[ $service == setsid ]] && precommands+=( setsid )
+
+_arguments -s -S -A '-*' : \
+  '(: * -)'{-h,--help}'[display help information]' \
+  '(: * -)'{-V,--version}'[display version information]' \
+  '(-c --ctty)'{-c,--ctty}'[set controlling terminal to current one]' \
+  '(-f --fork)'{-f,--fork}'[always fork]' \
+  '(-w --wait)'{-w,--wait}'[wait for program to exit, and use same return code]' \
+  '1: :_path_commands' \
+  '*:: : _normal'
diff --git a/Completion/Zsh/Command/_exec b/Completion/Zsh/Command/_exec
new file mode 100644
index 000000000..8de341a02
--- /dev/null
+++ b/Completion/Zsh/Command/_exec
@@ -0,0 +1,9 @@
+#compdef exec
+
+[[ $service == exec ]] && precommands+=( exec )
+
+_arguments -s -S -A '-*' : \
+  '-a+[set argv\[0\] to specified string]:argv[0] string' \
+  '-c[clear environment]' \
+  '-l[simulate login shell (prepend - to argv\[0\])]' \
+  '*:: : _normal'
diff --git a/Completion/Zsh/Command/_precommand b/Completion/Zsh/Command/_precommand
index f57e668c6..c9eef78af 100644
--- a/Completion/Zsh/Command/_precommand
+++ b/Completion/Zsh/Command/_precommand
@@ -1,4 +1,4 @@
-#compdef - nohup eval time rusage noglob nocorrect exec catchsegv aoss hilite eatmydata setsid
+#compdef - nohup eval time rusage noglob nocorrect catchsegv aoss hilite eatmydata
 
 # precommands is made local in _main_complete
 precommands+=($words[1])


^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-31  2:13 [PATCH] Completion: Break out _exec, _setsid dana

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/ public-inbox