summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-02-21 08:30:18 +0000
committerJim Meyering <jim@meyering.net>2003-02-21 08:30:18 +0000
commit6fe8f2a831293acd3f37bc1bf4963ed5adb88caa (patch)
tree9d462edf4c2629b0b2dc1a99dbba88c0c2a7c9eb /src
parent7dc3ed2f0455ea462a33b148e910c0daf282f9bd (diff)
downloadcoreutils-6fe8f2a831293acd3f37bc1bf4963ed5adb88caa.tar.xz
New option: --apparent-size.
(enum) [APPARENT_SIZE_OPTION]: New member. (long_options): Add it. (usage): Describe it. (main): Handle it. ['b']: Set apparent_size.
Diffstat (limited to 'src')
-rw-r--r--src/du.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/du.c b/src/du.c
index 49c0189ec..afc3e0eae 100644
--- a/src/du.c
+++ b/src/du.c
@@ -137,13 +137,15 @@ int G_fail;
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
{
- EXCLUDE_OPTION = CHAR_MAX + 1,
+ APPARENT_SIZE_OPTION = CHAR_MAX + 1,
+ EXCLUDE_OPTION,
MAX_DEPTH_OPTION
};
static struct option const long_options[] =
{
{"all", no_argument, NULL, 'a'},
+ {"apparent-size", no_argument, NULL, APPARENT_SIZE_OPTION},
{"block-size", required_argument, 0, 'B'},
{"bytes", no_argument, NULL, 'b'},
{"count-links", no_argument, NULL, 'l'},
@@ -183,8 +185,12 @@ Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --all write counts for all files, not just directories\n\
+ --apparent-size print apparent sizes, rather than disk usage; although\n\
+ the apparent size is usually smaller, it may be\n\
+ larger due to holes in (`sparse') files, internal\n\
+ fragmentation, indirect blocks, and the like\n\
-B, --block-size=SIZE use SIZE-byte blocks\n\
- -b, --bytes print size in bytes\n\
+ -b, --bytes equivalent to `--apparent-size --block-size=1'\n\
-c, --total produce a grand total\n\
-D, --dereference-args dereference FILEs that are symbolic links\n\
"), stdout);
@@ -586,7 +592,12 @@ main (int argc, char **argv)
opt_all = 1;
break;
+ case APPARENT_SIZE_OPTION:
+ apparent_size = 1;
+ break;
+
case 'b':
+ apparent_size = 1;
human_output_opts = 0;
output_block_size = 1;
break;