public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Patch for shutdown
@ 2013-05-20 11:41 Frank Fesevur
  2013-05-20 13:21 ` Jeffrey Altman
  2013-05-21  9:42 ` Corinna Vinschen
  0 siblings, 2 replies; 15+ messages in thread
From: Frank Fesevur @ 2013-05-20 11:41 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

Hi Corinna,

Since nobody made real objections about changing the short flag for
hibernate from -h to -b to make room for -h for halt [1], I created a
patch to change the shutdown program. The patch was created back in
March, but with all your work being done on cygwin64, your holiday and
myself being very busy with life it was held back.

There were no change to the shutdown CVS since then so here is that
patch, including a changelog.

Note that I didn't change the programs version number in this patch. I
don't know if changing an existing option would require/justify to
change the version from 1.9 to 2.0 instead of simply to 1.10?

Regards,
Frank

[1] http://cygwin.com/ml/cygwin/2013-03/msg00354.html

[-- Attachment #2: CHANGELOG --]
[-- Type: application/octet-stream, Size: 427 bytes --]

2013-03-23  Frank Fesevur  <ffes@users.sourceforge.net>

	* Changed the short option for hibernate from -h to -b.
	* Added -h, --halt as additional option for shutdown and -c, --cancel as additional option for abort.
	* Updated shutdown.8 man pages to reflect these changes.
	* Fixed typo: changed text InitateSystemShutdown to InitiateSystemShutdownEx in the two usage() functions in shutdown.c and in shutdown.8 and reboot.8

[-- Attachment #3: shutdown.patch --]
[-- Type: application/octet-stream, Size: 5549 bytes --]

? CHANGELOG
? shutdown.patch
Index: reboot.8
===================================================================
RCS file: /cvs/cygwin-apps/shutdown/reboot.8,v
retrieving revision 1.1
diff -u -p -r1.1 reboot.8
--- reboot.8	21 Mar 2013 11:58:00 -0000	1.1
+++ reboot.8	25 Mar 2013 11:26:12 -0000
@@ -19,7 +19,7 @@ reboot, halt, poweroff, hibernate, suspe
 .B suspend
 [\fIoptions\fR]
 .SH DESCRIPTION
-These programs allow to
+These programs allow the user to
 .BR reboot ", " halt ", " poweroff ", " hibernate " or " suspend
 the system.
 .PP
@@ -30,7 +30,7 @@ They are aliases for \fBshutdown --reboo
 Forces the execution. This can cause applications to lose data.
 .TP
 \fB\-x\fR, \fB\-\-exitex\fR
-Use ExitWindowsEx rather than InitateSystemShutdown.
+Use ExitWindowsEx rather than InitiateSystemShutdownEx.
 .TP
 \fB\-\-help\fR
 Display a help text and exit.
Index: shutdown.8
===================================================================
RCS file: /cvs/cygwin-apps/shutdown/shutdown.8,v
retrieving revision 1.1
diff -u -p -r1.1 shutdown.8
--- shutdown.8	21 Mar 2013 11:58:00 -0000	1.1
+++ shutdown.8	25 Mar 2013 11:26:12 -0000
@@ -26,23 +26,29 @@ which specifies the time on the 24hr clo
 \fB\-f\fR, \fB\-\-force\fR
 Forces the execution. This can cause applications to lose data.
 .TP
-\fB\-s\fR, \fB\-\-shutdown\fR
+\fB\-h\fR, \fB\-\-halt\fR
 The system will shutdown and power off. This is the default action. The system must support the power-off feature, but most systems do.
 .TP
+\fB\-s\fR, \fB\-\-shutdown\fR
+Same as --halt. Here for compatibility with the Windows shutdown command line tool.
+.TP
 \fB\-r\fR, \fB\-\-reboot\fR
 The system will shutdown and then restart.
 .TP
-\fB\-h\fR, \fB\-\-hibernate\fR
+\fB\-b\fR, \fB\-\-hibernate\fR
 The system will suspend to disk. The system must support the hibernate feature.
 .TP
 \fB\-p\fR, \fB\-\-suspend\fR
 The system will suspend to RAM. This is also known as sleep or standby. The system must support the suspend feature.
 .TP
-\fB\-a\fR, \fB\-\-abort\fR
+\fB\-c\fR, \fB\-\-cancel\fR
 Aborts the execution of formerly started shutdown or reboot.
 .TP
+\fB\-a\fR, \fB\-\-abort\fR
+Same as --cancel. Here for compatibility with the Windows shutdown command line tool.
+.TP
 \fB\-x\fR, \fB\-\-exitex\fR
-Use ExitWindowsEx rather than InitateSystemShutdown.
+Use ExitWindowsEx rather than InitiateSystemShutdownEx.
 .TP
 \fB\-\-help\fR
 Display a help text and exit.
Index: shutdown.c
===================================================================
RCS file: /cvs/cygwin-apps/shutdown/shutdown.c,v
retrieving revision 1.4
diff -u -p -r1.4 shutdown.c
--- shutdown.c	21 Mar 2013 11:58:35 -0000	1.4
+++ shutdown.c	25 Mar 2013 11:26:12 -0000
@@ -63,12 +63,14 @@ usage_shutdown (void)
   printf ("Usage: %s [OPTION]... time\n", myname);
   printf ("Bring the system down.\n\n");
   printf ("  -f, --force      Forces the execution.\n");
+  printf ("  -h, --halt       The system will shutdown and power off (if supported)\n");
   printf ("  -s, --shutdown   The system will shutdown and power off (if supported)\n");
   printf ("  -r, --reboot     The system will reboot.\n");
-  printf ("  -h, --hibernate  The system will suspend to disk (if supported)\n");
+  printf ("  -b, --hibernate  The system will suspend to disk (if supported)\n");
   printf ("  -p, --suspend    The system will suspend to RAM (if supported)\n");
+  printf ("  -c, --cancel     Aborts execution of formerly started shutdown.\n");
   printf ("  -a, --abort      Aborts execution of formerly started shutdown.\n");
-  printf ("  -x, --exitex     Use ExitWindowsEx rather than InitateSystemShutdown.\n");
+  printf ("  -x, --exitex     Use ExitWindowsEx rather than InitiateSystemShutdownEx.\n");
   printf ("      --help       Display this help and exit.\n");
   printf ("      --version    Output version information and exit.\n");
   printf ("\n`time' is either the time in seconds or `+' and the time in minutes or a\n");
@@ -98,7 +100,7 @@ usage_reboot (void)
   }
 
   printf ("  -f, --force      Forces the execution.\n");
-  printf ("  -x, --exitex     Use ExitWindowsEx rather than InitateSystemShutdown.\n");
+  printf ("  -x, --exitex     Use ExitWindowsEx rather than InitiateSystemShutdownEx.\n");
   printf ("      --help       Display this help and exit.\n");
   printf ("      --version    Output version information and exit.\n");
   return 0;
@@ -166,18 +168,20 @@ parse_cmdline_shutdown(int argc, char **
 {
   struct option longopts[] = {
     {"abort", no_argument, NULL, 'a'},
+    {"cancel", no_argument, NULL, 'c'},
     {"exitex", no_argument, NULL, 'x'},
     {"force", no_argument, NULL, 'f'},
     {"shutdown", no_argument, NULL, 's'},
+    {"halt", no_argument, NULL, 'h'},
     {"reboot", no_argument, NULL, 'r'},
-    {"hibernate", no_argument, NULL, 'h'},
+    {"hibernate", no_argument, NULL, 'b'},
     {"suspend", no_argument, NULL, 'p'},
     {"help", no_argument, NULL, 'H'},
     {"version", no_argument, NULL, 'v'},
     {0, no_argument, NULL, 0}
   };
 
-  char opts[] = "axfsrhp";
+  char opts[] = "acxfshrbp";
   int c;
   char *arg, *endptr;
 
@@ -188,18 +192,20 @@ parse_cmdline_shutdown(int argc, char **
 	force = EWX_FORCE;
 	break;
       case 's':
+      case 'h':
         action = EWX_POWEROFF;
 	break;
       case 'r':
 	action = EWX_REBOOT;
 	break;
-      case 'h':
+      case 'b':
         action = HIBERNATE;
 	break;
       case 'p':
         action = SUSPEND;
 	break;
       case 'a':
+      case 'c':
 	action = ABORT;
 	break;
       case 'x':

[-- Attachment #4: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2013-06-06 14:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-20 11:41 Patch for shutdown Frank Fesevur
2013-05-20 13:21 ` Jeffrey Altman
2013-05-20 13:59   ` Fedin Pavel
2013-05-20 14:07     ` Earnie Boyd
2013-05-20 14:23     ` Jeffrey Altman
2013-05-20 17:50     ` Andrey Repin
2013-05-21 13:01     ` Buchbinder, Barry (NIH/NIAID) [E]
2013-05-20 20:32   ` Frank Fesevur
2013-05-21  9:42 ` Corinna Vinschen
2013-05-21 15:20   ` Frank Fesevur
2013-05-21 16:05     ` Corinna Vinschen
2013-05-21 20:00       ` Frank Fesevur
2013-05-22  8:18         ` Corinna Vinschen
2013-06-06 12:22           ` Frank Fesevur
2013-06-06 14:29             ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).