diff options
author | Denis Vlasenko | 2008-08-28 22:42:52 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-08-28 22:42:52 +0000 |
commit | d66aa3c701ffb83343239e71a8b294407ff5df86 (patch) | |
tree | eeebccfe994962aa8a33312c8726eac5adf63f5a /include | |
parent | 3b80cac953b0627ba9b3337d3f9386678d436871 (diff) | |
download | busybox-d66aa3c701ffb83343239e71a8b294407ff5df86.zip busybox-d66aa3c701ffb83343239e71a8b294407ff5df86.tar.gz |
df: add support for more options, add some coreutils 6.10 compat.
by Bernhard Reutner-Fischer
function old new delta
df_main 664 795 +131
packed_usage 24812 24862 +50
make_human_readable_str 213 262 +49
static.ignored_mounts - 8 +8
static.unit_chars - 7 +7
static.zero_and_units 6 - -6
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 3/0 up/down: 245/-6) Total: 239 bytes
Diffstat (limited to 'include')
-rw-r--r-- | include/usage.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/include/usage.h b/include/usage.h index 41012af..a09f7ea 100644 --- a/include/usage.h +++ b/include/usage.h @@ -705,36 +705,40 @@ "\n do not poll for events" \ ) -/* -k is accepted but ignored for !HUMAN_READABLE, - * but we won't mention this (unimportant) */ -#if ENABLE_FEATURE_HUMAN_READABLE || ENABLE_FEATURE_DF_INODE -#define DF_HAS_OPTIONS(x) x -#else -#define DF_HAS_OPTIONS(x) -#endif #define df_trivial_usage \ - DF_HAS_OPTIONS("[-") \ - USE_FEATURE_HUMAN_READABLE("hmk") USE_FEATURE_DF_INODE("i") \ - DF_HAS_OPTIONS("] ") "[FILESYSTEM...]" + "[-Pk" \ + USE_FEATURE_HUMAN_READABLE("mh") \ + USE_FEATURE_DF_FANCY("ai] [-B SIZE") \ + "] [FILESYSTEM...]" #define df_full_usage "\n\n" \ "Print filesystem usage statistics\n" \ - DF_HAS_OPTIONS("\nOptions:") \ + "\nOptions:" \ + "\n -P POSIX output format" \ + "\n -k 1024-byte blocks (default)" \ USE_FEATURE_HUMAN_READABLE( \ + "\n -m 1M-byte blocks" \ "\n -h Human readable (e.g. 1K 243M 2G)" \ - "\n -m 1024*1024 blocks" \ - "\n -k 1024 blocks" \ ) \ - USE_FEATURE_DF_INODE( \ + USE_FEATURE_DF_FANCY( \ + "\n -a Show all filesystems" \ "\n -i Inodes" \ - ) + "\n -B SIZE Blocksize" \ + ) \ + #define df_example_usage \ "$ df\n" \ - "Filesystem 1k-blocks Used Available Use% Mounted on\n" \ + "Filesystem 1K-blocks Used Available Use% Mounted on\n" \ "/dev/sda3 8690864 8553540 137324 98% /\n" \ "/dev/sda1 64216 36364 27852 57% /boot\n" \ "$ df /dev/sda3\n" \ - "Filesystem 1k-blocks Used Available Use% Mounted on\n" \ - "/dev/sda3 8690864 8553540 137324 98% /\n" + "Filesystem 1K-blocks Used Available Use% Mounted on\n" \ + "/dev/sda3 8690864 8553540 137324 98% /\n" \ + "$ POSIXLY_CORRECT=sure df /dev/sda3\n" \ + "Filesystem 512B-blocks Used Available Use% Mounted on\n" \ + "/dev/sda3 17381728 17107080 274648 98% /\n" \ + "$ POSIXLY_CORRECT=yep df -P /dev/sda3\n" \ + "Filesystem 512-blocks Used Available Capacity Mounted on\n" \ + "/dev/sda3 17381728 17107080 274648 98% /\n" #define dhcprelay_trivial_usage \ "[client1,client2,...] [server_device]" |