Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: shutdown completion
- X-seq: zsh-workers 42578
- From: Jun T <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: shutdown completion
- Date: Tue, 3 Apr 2018 18:52:44 +0900
- In-reply-to: <18406.1522407738@thecus>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <18406.1522407738@thecus>
Add support for macOS.
Are there any linux systems (not using systemd) where
'-p' (lower case 'p') means 'turn off power after shutdown'?
diff --git a/Completion/Unix/Command/_shutdown b/Completion/Unix/Command/_shutdown
index 1ac6e61ba..9726182a0 100644
--- a/Completion/Unix/Command/_shutdown
+++ b/Completion/Unix/Command/_shutdown
@@ -17,10 +17,9 @@ if [[ -d /etc/systemd ]]; then
fi
case $OSTYPE in
- *bsd*|dragonfly*|linux*)
+ *bsd*|dragonfly*|linux*|darwin*)
args=(
'-h[halt the system after shutdown]'
- '-p[turn off power after shutdown]'
'-r[reboot the system]'
'-k[kick everybody off]'
'-n[prevent file system cache from being flushed]'
@@ -28,6 +27,11 @@ case $OSTYPE in
'*:warning message'
)
;|
+ *bsd*|dragonfly*|linux*)
+ args=(
+ '-p[turn off power after shutdown]'
+ )
+ ;|
(net|open)bsd*)
args+=(
'-d[cause system to perform a dump]'
@@ -48,6 +52,13 @@ case $OSTYPE in
'-D[prevent shutdown from detaching from the tty]'
)
;;
+ darwin*)
+ args+=(
+ '-o[execute halt or reboot instead of sending a signal to launchd]'
+ '-s[put the system to sleep]'
+ '-u[with -h, wait 5 minutes before removing power]'
+ )
+ ;;
solaris2.<11->) args=( '(-i)-r[reboot]' ) ;&
solaris*)
args+=(
Messages sorted by:
Reverse Date,
Date,
Thread,
Author