Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2024 16:22:04 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d349bd35330d - main - shutdown: fix option sorting
Message-ID:  <202408091622.479GM4O3081215@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=d349bd35330d3ec7ce1d3e7d6c2d6fc1f6a95704

commit d349bd35330d3ec7ce1d3e7d6c2d6fc1f6a95704
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2024-08-09 16:21:00 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2024-08-09 16:21:00 +0000

    shutdown: fix option sorting
    
    A last minute change moved this from -W to -q; fix the sorting in a few
    places to reflect that.
    
    Fixes: 6c7ec630c24 ("shutdown: add a -q(uiet) flag to suppress [...]")
    Sponsored by:   Klara, Inc.
---
 sbin/shutdown/shutdown.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index 101e003b44e2..e92d41220a20 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -133,7 +133,7 @@ main(int argc, char **argv)
 		goto poweroff;
 	}
 
-	while ((ch = getopt(argc, argv, "-chknoprq")) != -1)
+	while ((ch = getopt(argc, argv, "-chknopqr")) != -1)
 		switch (ch) {
 		case '-':
 			readstdin = 1;
@@ -156,12 +156,12 @@ main(int argc, char **argv)
 		case 'p':
 			dopower = 1;
 			break;
-		case 'r':
-			doreboot = 1;
-			break;
 		case 'q':
 			dowarn = false;
 			break;
+		case 'r':
+			doreboot = 1;
+			break;
 		case '?':
 		default:
 			usage((char *)NULL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202408091622.479GM4O3081215>