diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-28 22:42:52 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-28 22:42:52 +0000 |
| commit | d66aa3c701ffb83343239e71a8b294407ff5df86 (patch) | |
| tree | eeebccfe994962aa8a33312c8726eac5adf63f5a /include | |
| parent | 3b80cac953b0627ba9b3337d3f9386678d436871 (diff) | |
| download | busybox-w32-d66aa3c701ffb83343239e71a8b294407ff5df86.tar.gz busybox-w32-d66aa3c701ffb83343239e71a8b294407ff5df86.tar.bz2 busybox-w32-d66aa3c701ffb83343239e71a8b294407ff5df86.zip | |
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 41012afc1..a09f7eac2 100644 --- a/include/usage.h +++ b/include/usage.h | |||
| @@ -705,36 +705,40 @@ | |||
| 705 | "\n do not poll for events" \ | 705 | "\n do not poll for events" \ |
| 706 | ) | 706 | ) |
| 707 | 707 | ||
| 708 | /* -k is accepted but ignored for !HUMAN_READABLE, | ||
| 709 | * but we won't mention this (unimportant) */ | ||
| 710 | #if ENABLE_FEATURE_HUMAN_READABLE || ENABLE_FEATURE_DF_INODE | ||
| 711 | #define DF_HAS_OPTIONS(x) x | ||
| 712 | #else | ||
| 713 | #define DF_HAS_OPTIONS(x) | ||
| 714 | #endif | ||
| 715 | #define df_trivial_usage \ | 708 | #define df_trivial_usage \ |
| 716 | DF_HAS_OPTIONS("[-") \ | 709 | "[-Pk" \ |
| 717 | USE_FEATURE_HUMAN_READABLE("hmk") USE_FEATURE_DF_INODE("i") \ | 710 | USE_FEATURE_HUMAN_READABLE("mh") \ |
| 718 | DF_HAS_OPTIONS("] ") "[FILESYSTEM...]" | 711 | USE_FEATURE_DF_FANCY("ai] [-B SIZE") \ |
| 712 | "] [FILESYSTEM...]" | ||
| 719 | #define df_full_usage "\n\n" \ | 713 | #define df_full_usage "\n\n" \ |
| 720 | "Print filesystem usage statistics\n" \ | 714 | "Print filesystem usage statistics\n" \ |
| 721 | DF_HAS_OPTIONS("\nOptions:") \ | 715 | "\nOptions:" \ |
| 716 | "\n -P POSIX output format" \ | ||
| 717 | "\n -k 1024-byte blocks (default)" \ | ||
| 722 | USE_FEATURE_HUMAN_READABLE( \ | 718 | USE_FEATURE_HUMAN_READABLE( \ |
| 719 | "\n -m 1M-byte blocks" \ | ||
| 723 | "\n -h Human readable (e.g. 1K 243M 2G)" \ | 720 | "\n -h Human readable (e.g. 1K 243M 2G)" \ |
| 724 | "\n -m 1024*1024 blocks" \ | ||
| 725 | "\n -k 1024 blocks" \ | ||
| 726 | ) \ | 721 | ) \ |
| 727 | USE_FEATURE_DF_INODE( \ | 722 | USE_FEATURE_DF_FANCY( \ |
| 723 | "\n -a Show all filesystems" \ | ||
| 728 | "\n -i Inodes" \ | 724 | "\n -i Inodes" \ |
| 729 | ) | 725 | "\n -B SIZE Blocksize" \ |
| 726 | ) \ | ||
| 727 | |||
| 730 | #define df_example_usage \ | 728 | #define df_example_usage \ |
| 731 | "$ df\n" \ | 729 | "$ df\n" \ |
| 732 | "Filesystem 1k-blocks Used Available Use% Mounted on\n" \ | 730 | "Filesystem 1K-blocks Used Available Use% Mounted on\n" \ |
| 733 | "/dev/sda3 8690864 8553540 137324 98% /\n" \ | 731 | "/dev/sda3 8690864 8553540 137324 98% /\n" \ |
| 734 | "/dev/sda1 64216 36364 27852 57% /boot\n" \ | 732 | "/dev/sda1 64216 36364 27852 57% /boot\n" \ |
| 735 | "$ df /dev/sda3\n" \ | 733 | "$ df /dev/sda3\n" \ |
| 736 | "Filesystem 1k-blocks Used Available Use% Mounted on\n" \ | 734 | "Filesystem 1K-blocks Used Available Use% Mounted on\n" \ |
| 737 | "/dev/sda3 8690864 8553540 137324 98% /\n" | 735 | "/dev/sda3 8690864 8553540 137324 98% /\n" \ |
| 736 | "$ POSIXLY_CORRECT=sure df /dev/sda3\n" \ | ||
| 737 | "Filesystem 512B-blocks Used Available Use% Mounted on\n" \ | ||
| 738 | "/dev/sda3 17381728 17107080 274648 98% /\n" \ | ||
| 739 | "$ POSIXLY_CORRECT=yep df -P /dev/sda3\n" \ | ||
| 740 | "Filesystem 512-blocks Used Available Capacity Mounted on\n" \ | ||
| 741 | "/dev/sda3 17381728 17107080 274648 98% /\n" | ||
| 738 | 742 | ||
| 739 | #define dhcprelay_trivial_usage \ | 743 | #define dhcprelay_trivial_usage \ |
| 740 | "[client1,client2,...] [server_device]" | 744 | "[client1,client2,...] [server_device]" |
