diff options
author | Rob Landley <rob@landley.net> | 2019-09-14 23:01:00 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-09-14 23:01:00 -0500 |
commit | c03a070f20cac4d38ac5f72534204522db63a04b (patch) | |
tree | d3a3b270107cb8a613e0cccc0e54ffad9d0f9deb | |
parent | 38509d0e217d57d9b7fb18727bd02277cd205566 (diff) | |
download | toybox-c03a070f20cac4d38ac5f72534204522db63a04b.tar.gz |
Add -newerXY
-rw-r--r-- | toys/posix/file.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/toys/posix/file.c b/toys/posix/file.c index d1e425bd..17bc45f7 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -4,18 +4,20 @@ * * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/file.html -USE_FILE(NEWTOY(file, "<1hL[!hL]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_FILE(NEWTOY(file, "<1bhLs[!hL]", TOYFLAG_USR|TOYFLAG_BIN)) config FILE bool "file" default y help - usage: file [-hL] [file...] + usage: file [-bhL] [file...] Examine the given files and describe their content types. + -b Brief (no filename) -h Don't follow symlinks (default) -L Follow symlinks + -s show block/char device contents */ #define FOR_file @@ -449,7 +451,8 @@ void file_main(void) struct stat sb; int fd = !strcmp(name, "-"); - xprintf("%s: %*s", name, (int)(TT.max_name_len - strlen(name)), ""); + if (!FLAG(b)) + xprintf("%s: %*s", name, (int)(TT.max_name_len - strlen(name)), ""); sb.st_size = 0; if (fd || !((toys.optflags & FLAG_L) ? stat : lstat)(name, &sb)) { |