From 35734810d1b042ca1fb4508ae3813ef999ff1aa9 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Thu, 5 Apr 2018 10:34:12 +0900 Subject: 42578: _shutdown: add support for macOS --- ChangeLog | 2 ++ Completion/Unix/Command/_shutdown | 15 +++++++++++++-- 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 * 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+=( -- cgit 1.4.1