aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
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))