aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ls.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2023-08-15 18:22:10 -0500
committerRob Landley <rob@landley.net>2023-08-15 18:22:10 -0500
commit4c535fe4adb1b282b58354dfa442f858128e2168 (patch)
tree94b081493836471ade951cdfc2160890be8b1b14 /toys/posix/ls.c
parent8deb5891fb4c4baedf5f2e7a36d5464053a10224 (diff)
downloadtoybox-4c535fe4adb1b282b58354dfa442f858128e2168.tar.gz
Make ls -k switch off --block-size, document it, and two fixes to lib/args.c.
1) handle the high bit octal escape syntax in [-abc] 2) switching off an option sets it back to the default value, not 0.
Diffstat (limited to 'toys/posix/ls.c')
-rw-r--r--toys/posix/ls.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index 3e1fad17..f3a5e92b 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -10,11 +10,10 @@
* add -Z -ll --color
* Posix says the -l date format should vary based on how recent it is
* and we do --time-style=long-iso instead
- * ignore -k because we default to 1024 byte blocks
* Deviations from gnu: -N switches off -q (no --show-control-chars)
* No --quoting-style=shell-escape, mostly because no short or long opt for it
-USE_LS(NEWTOY(ls, "(sort):(color):;(full-time)(block-size)#=1024<1(show-control-chars)\241(group-directories-first)\376ZgoACFHLNRSUXabcdfhikl@mnpqrstuw#=80<0x1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][-Nqb]", TOYFLAG_BIN|TOYFLAG_LOCALE))
+USE_LS(NEWTOY(ls, "(sort):(color):;(full-time)(show-control-chars)\377(block-size)#=1024<1\241(group-directories-first)\376ZgoACFHLNRSUXabcdfhikl@mnpqrstuw#=80<0x1[-Cxm1][-Cxml][-Cxmo][-Cxmg][-cu][-ftS][-HL][-Nqb][-k\377]", TOYFLAG_BIN|TOYFLAG_LOCALE))
config LS
bool "ls"
@@ -37,16 +36,17 @@ config LS
output formats:
-1 list one file per line -C columns (sorted vertically)
-g like -l but no owner -h human readable sizes
- -l long (show full details) -ll long with nanoseconds (--full-time)
- -m comma separated -n long with numeric uid/gid
- -o long without group column -r reverse order
- -w set column width -x columns (horizontal sort)
+ -k reset --block-size to default -l long (show full details)
+ -m comma separated -ll long with nanoseconds (--full-time)
+ -n long with numeric uid/gid -o long without group column
+ -r reverse order -w set column width
+ -x columns (horizontal sort)
sort by: (also --sort=longname,longname... ends with alphabetical)
-c ctime -r reverse -S size -t time -u atime -U none
-X extension -! dirfirst -~ nocase
- --block-size N block size (default 1024)
+ --block-size N block size (default 1024, -k resets to 1024)
--color =always (default) =auto (when stdout is tty) =never
exe=green suid=red suidfile=redback stickydir=greenback
device=yellow symlink=turquoise/red dir=blue socket=purple