From 02261e8082b9b098b20a4291fc2583f3c41db8d2 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 15 Nov 2012 16:15:51 -0600 Subject: Make ls default to -C if no option specified and it's outputting to a tty. --- toys/posix/ls.c | 1 + 1 file changed, 1 insertion(+) (limited to 'toys/posix') diff --git a/toys/posix/ls.c b/toys/posix/ls.c index 201c7e24..70200e7c 100644 --- a/toys/posix/ls.c +++ b/toys/posix/ls.c @@ -426,6 +426,7 @@ void ls_main(void) else { TT.screen_width = 80; terminal_size(&TT.screen_width, NULL); + if (!(toys.optflags&(FLAG_1|FLAG_x|FLAG_m))) toys.optflags |= FLAG_C; } // The optflags parsing infrastructure should really do this for us, // but currently it has "switch off when this is set", so "-dR" and "-Rd" -- cgit v1.2.3