Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: shutdown completion



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