about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-04-05 10:34:12 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2018-04-05 10:34:12 +0900
commit35734810d1b042ca1fb4508ae3813ef999ff1aa9 (patch)
treecd0b79529c4dcdd83f7c2156c4090644dc61399d
parente9a76d392449801456c4b47733f187d219477786 (diff)
downloadzsh-35734810d1b042ca1fb4508ae3813ef999ff1aa9.tar.gz
zsh-35734810d1b042ca1fb4508ae3813ef999ff1aa9.tar.xz
zsh-35734810d1b042ca1fb4508ae3813ef999ff1aa9.zip
42578: _shutdown: add support for macOS
-rw-r--r--ChangeLog2
-rw-r--r--Completion/Unix/Command/_shutdown15
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ff97d936..038fb91a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
 	* 42577: Completion/Unix/Command/_strings: fix macOS support
 
+	* 42578: Completion/Unix/Command/_shutdown: add support for macOS
+
 2018-04-04  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* unposted: 5.4.2-test-2.
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+=(