git: d854370fa86b - main - ls: versort incompatible w/ timesort and sizesort

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 02 Feb 2024 20:23:00 UTC
The branch main has been updated by imp:

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

commit d854370fa86b74527e57145955b1fa3ca75643a2
Author:     Alexander Ziaee <concussious@runbox.com>
AuthorDate: 2024-02-02 20:19:07 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-02-02 20:19:10 +0000

    ls: versort incompatible w/ timesort and sizesort
    
    ls.1: versort incompatible w/ timesort and sizesort
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/825
---
 bin/ls/ls.1 |  6 +++---
 bin/ls/ls.c | 12 ++++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/bin/ls/ls.1 b/bin/ls/ls.1
index 4f680d97ea0b..d3daf6e12019 100644
--- a/bin/ls/ls.1
+++ b/bin/ls/ls.1
@@ -29,7 +29,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd July 18, 2023
+.Dd January 12, 2024
 .Dt LS 1
 .Os
 .Sh NAME
@@ -457,9 +457,9 @@ options all override each other; the last one specified determines
 the file time used.
 .Pp
 The
-.Fl S
+.Fl S , t
 and
-.Fl t
+.Fl v
 options override each other; the last one specified determines
 the sort order used.
 .Pp
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 6af7715fa5f0..7ebcc5383863 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -313,14 +313,21 @@ main(int argc, char *argv[])
 		case 'A':
 			f_listdot = 1;
 			break;
-		/* The -t and -S options override each other. */
+		/* The -S, -t and -v options override each other. */
 		case 'S':
 			f_sizesort = 1;
 			f_timesort = 0;
+			f_verssort = 0;
 			break;
 		case 't':
 			f_timesort = 1;
 			f_sizesort = 0;
+			f_verssort = 0;
+			break;
+		case 'v':
+			f_verssort = 1;
+			f_sizesort = 0;
+			f_verssort = 0;
 			break;
 		/* Other flags.  Please keep alphabetic. */
 		case ',':
@@ -434,9 +441,6 @@ main(int argc, char *argv[])
 		case 's':
 			f_size = 1;
 			break;
-		case 'v':
-			f_verssort = 1;
-			break;
 		case 'w':
 			f_nonprint = 0;
 			f_octal = 0;