aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-02-13 16:41:51 -0500
committerRob Landley <rob@landley.net>2007-02-13 16:41:51 -0500
commit2aa494dcfe701e080e62f3d2a36af84b2ee16837 (patch)
tree9f6a33a599833e6211f3891bb39fd7c784784ce5 /toys
parent4f5a671bf49bcce98be1a0be847cf4f5eaeacd2a (diff)
downloadtoybox-2aa494dcfe701e080e62f3d2a36af84b2ee16837.tar.gz
MacOS X has a defective sed with no -r.
Diffstat (limited to 'toys')
-rw-r--r--toys/Config.in14
-rw-r--r--toys/toylist.h7
2 files changed, 21 insertions, 0 deletions
diff --git a/toys/Config.in b/toys/Config.in
index 64fa2a28..7768ec89 100644
--- a/toys/Config.in
+++ b/toys/Config.in
@@ -172,6 +172,20 @@ config PWD
The print working directory command prints the current directory.
+config TOUCH
+ bool "touch"
+ default n
+ help
+ usage: touch [-acmrt] FILE...
+
+ Change file timestamps/length. Create empty or sparse files.
+
+ -a
+ -c
+ -m
+ -r
+ -t
+
config TOYSH
bool "sh (toysh)"
default n
diff --git a/toys/toylist.h b/toys/toylist.h
index ae2ff2c5..c2fff141 100644
--- a/toys/toylist.h
+++ b/toys/toylist.h
@@ -31,6 +31,12 @@ struct mke2fs_data {
struct dirtree *dt;
};
+struct touch_data {
+ char *ref_file;
+ char *time;
+ long length;
+};
+
// "E:jJ:L:m:O:"
#define MKE2FS_OPTSTRING "<1>2Fnqm#N#i#b#"
@@ -75,6 +81,7 @@ USE_MKE2FS(NEWTOY(mke2fs, MKE2FS_OPTSTRING, TOYFLAG_SBIN))
USE_ONEIT(NEWTOY(oneit, "+p<1", TOYFLAG_SBIN))
USE_PWD(NEWTOY(pwd, NULL, TOYFLAG_BIN))
USE_TOYSH(OLDTOY(sh, toysh, "c:i", TOYFLAG_BIN))
+USE_TOUCH(NEWTOY(touch, "l#t:r:mca", TOYFLAG_BIN))
USE_TOYSH(NEWTOY(toysh, "c:i", TOYFLAG_BIN))
USE_WHICH(NEWTOY(which, "a", TOYFLAG_USR|TOYFLAG_BIN))
USE_YES(NEWTOY(yes, "", TOYFLAG_USR|TOYFLAG_BIN))