summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Frysinger2005-04-23 06:26:38 +0000
committerMike Frysinger2005-04-23 06:26:38 +0000
commit9b5f71ec029776e21bda6c4c61e6b463fd3a2314 (patch)
tree962bf98157f322d70e5c0fdd7fce5ef6865bbd3d /include
parent84ab267e226407ee402eff10aaf8239ed684de77 (diff)
downloadbusybox-9b5f71ec029776e21bda6c4c61e6b463fd3a2314.zip
busybox-9b5f71ec029776e21bda6c4c61e6b463fd3a2314.tar.gz
stat implementation based upon coreutils
Diffstat (limited to 'include')
-rw-r--r--include/applets.h3
-rw-r--r--include/usage.h57
2 files changed, 60 insertions, 0 deletions
diff --git a/include/applets.h b/include/applets.h
index 5ecdf79..957bc20 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -542,6 +542,9 @@
#ifdef CONFIG_START_STOP_DAEMON
APPLET_ODDNAME("start-stop-daemon", start_stop_daemon_main, _BB_DIR_SBIN, _BB_SUID_NEVER, start_stop_daemon)
#endif
+#ifdef CONFIG_STAT
+ APPLET(stat, stat_main, _BB_DIR_BIN, _BB_SUID_NEVER)
+#endif
#ifdef CONFIG_STRINGS
APPLET(strings, strings_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
diff --git a/include/usage.h b/include/usage.h
index cc2aa32..8941e18 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -2320,6 +2320,63 @@
"\n\t-q|--quiet\t\t\tbe quiet" \
"\n\t-s|--signal <signal>\t\tsignal to send (default TERM)"
+#ifdef CONFIG_FEATURE_STAT_FORMAT
+# define USAGE_STAT_FORMAT(a) a
+#else
+# define USAGE_STAT_FORMAT(a)
+#endif
+#define stat_trivial_usage \
+ "[OPTION] FILE..."
+#define stat_full_usage \
+ "display file (default) or filesystem status.\n\n" \
+ "Options:\n" \
+ USAGE_STAT_FORMAT("\t-c fmt\tuse the specified format\n") \
+ "\t-f\tdisplay filesystem status\n" \
+ "\t-L,-l\tdereference links\n" \
+ "\t-t\tdisplay info in terse form\n" \
+ USAGE_STAT_FORMAT( \
+ "\nValid format sequences for files:\n" \
+ " %a Access rights in octal\n" \
+ " %A Access rights in human readable form\n" \
+ " %b Number of blocks allocated (see %B)\n" \
+ " %B The size in bytes of each block reported by %b\n" \
+ " %d Device number in decimal\n" \
+ " %D Device number in hex\n" \
+ " %f Raw mode in hex\n" \
+ " %F File type\n" \
+ " %g Group ID of owner\n" \
+ " %G Group name of owner\n" \
+ " %h Number of hard links\n" \
+ " %i Inode number\n" \
+ " %n File name\n" \
+ " %N Quoted file name with dereference if symbolic link\n" \
+ " %o I/O block size\n" \
+ " %s Total size, in bytes\n" \
+ " %t Major device type in hex\n" \
+ " %T Minor device type in hex\n" \
+ " %u User ID of owner\n" \
+ " %U User name of owner\n" \
+ " %x Time of last access\n" \
+ " %X Time of last access as seconds since Epoch\n" \
+ " %y Time of last modification\n" \
+ " %Y Time of last modification as seconds since Epoch\n" \
+ " %z Time of last change\n" \
+ " %Z Time of last change as seconds since Epoch\n" \
+ "\nValid format sequences for file systems:\n" \
+ " %a Free blocks available to non-superuser\n" \
+ " %b Total data blocks in file system\n" \
+ " %c Total file nodes in file system\n" \
+ " %d Free file nodes in file system\n" \
+ " %f Free blocks in file system\n" \
+ " %i File System ID in hex\n" \
+ " %l Maximum length of filenames\n" \
+ " %n File name\n" \
+ " %s Block size (for faster transfers)\n" \
+ " %S Fundamental block size (for block counts)\n" \
+ " %t Type in hex\n" \
+ " %T Type in human readable form\n" \
+ )
+
#define strings_trivial_usage \
"[-afo] [-n length] [file ... ]"
#define strings_full_usage \