summaryrefslogtreecommitdiff
path: root/applets/usage.c
diff options
context:
space:
mode:
authorRichard June2001-01-22 22:35:38 +0000
committerRichard June2001-01-22 22:35:38 +0000
commit6d0921cc0bb01b1d090285c487f8c1120dfa5d3a (patch)
tree97ed53aec9cbe3a3021804e9758abb3e04f05879 /applets/usage.c
parent3b3f5c364a486dc2c081f0684a4315740f349be1 (diff)
downloadbusybox-6d0921cc0bb01b1d090285c487f8c1120dfa5d3a.zip
busybox-6d0921cc0bb01b1d090285c487f8c1120dfa5d3a.tar.gz
Add HUMAN_READABLE define for -m and -h support in du, df, and ls
Add support for -k in du, df, and ls(no define, it's for compatibliity with the GNU utils as bb does -k by default) Fix bug #1084
Diffstat (limited to 'applets/usage.c')
-rw-r--r--applets/usage.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/applets/usage.c b/applets/usage.c
index 8648917..9ae2bb3 100644
--- a/applets/usage.c
+++ b/applets/usage.c
@@ -190,9 +190,22 @@ const char deallocvt_usage[] =
#if defined BB_DF
const char df_usage[] =
- "df [filesystem ...]"
+ "df [-?"
+#ifdef BB_FEATURE_HUMAN_READABLE
+ "hm"
+#endif
+ "k] [filesystem ...]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\n\nPrint the filesystem space used and space available."
+ "Options:\n"
+ "\t-?\tshow usage information\n"
+#ifdef BB_FEATURE_HUMAN_READABLE
+ "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
+ "\t-m\tprint sizes in megabytes\n"
+ "\t-k\tprint sizes in kilobytes(default)\n"
+#else
+ "\t-k\tprint sizes in kilobytes(compatability)\n"
+#endif
#endif
;
#endif
@@ -244,13 +257,25 @@ const char dpkg_deb_usage[] =
#if defined BB_DU
const char du_usage[] =
- "du [OPTION]... [FILE]..."
+ "du [-?ls"
+#ifdef BB_FEATURE_HUMAN_READABLE
+ "hm"
+#endif
+ "k] [FILE]...\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\n\nSummarizes disk space used for each FILE and/or directory.\n"
"Disk space is printed in units of 1024 bytes.\n\n"
"Options:\n"
+ "\t-?\tshow usage information\n"
"\t-l\tcount sizes many times if hard linked\n"
"\t-s\tdisplay only a total for each argument"
+#ifdef BB_FEATURE_HUMAN_READABLE
+ "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
+ "\t-m\tprint sizes in megabytes\n"
+ "\t-k\tprint sizes in kilobytes(default)\n"
+#else
+ "\t-k\tprint sizes in kilobytes(compatability)\n"
+#endif
#endif
;
#endif
@@ -661,7 +686,10 @@ const char ls_usage[] =
#ifdef BB_FEATURE_LS_SORTFILES
"X"
#endif
- "] [filenames...]"
+#ifdef BB_FEATURE_HUMAN_READABLE
+ "h"
+#endif
+ "k] [filenames...]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\n\nList directory contents\n\n"
"Options:\n"
@@ -716,6 +744,14 @@ const char ls_usage[] =
#ifdef BB_FEATURE_LS_SORTFILES
"\t-X\tsort the listing by extension\n"
#endif
+
+#ifdef BB_FEATURE_HUMAN_READABLE
+ "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n"
+ "\t-k\tprint sizes in kilobytes(default)\n"
+#else
+ "\t-k\tprint sizes in kilobytes(compatability)"
+#endif
+
#endif /* BB_FEATURE_TRIVIAL_HELP */
;
#endif /* BB_LS */