summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko2010-12-01 13:06:03 +0100
committerDenys Vlasenko2010-12-01 13:06:03 +0100
commit3f2477e8a89ddadd1dfdd9d990ac8c6fdb8ad4b3 (patch)
treef672972cbfd8cf87a1c386235fbb5522331d1a89 /coreutils
parent631fd5ccd7372e2c09e953cc3c5d0176ee2bc6d2 (diff)
downloadbusybox-3f2477e8a89ddadd1dfdd9d990ac8c6fdb8ad4b3.zip
busybox-3f2477e8a89ddadd1dfdd9d990ac8c6fdb8ad4b3.tar.gz
touch: fix help text to not show options disabled in .config
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/Config.src7
-rw-r--r--coreutils/Kbuild.src1
-rw-r--r--coreutils/touch.c29
3 files changed, 29 insertions, 8 deletions
diff --git a/coreutils/Config.src b/coreutils/Config.src
index 0eb70af..c2fd73e 100644
--- a/coreutils/Config.src
+++ b/coreutils/Config.src
@@ -661,13 +661,6 @@ config FEATURE_TEE_USE_BLOCK_IO
help
Enable this option for a faster tee, at expense of size.
-config TOUCH
- bool "touch"
- default y
- help
- touch is used to create or change the access and/or
- modification timestamp of specified files.
-
config TRUE
bool "true"
default y
diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src
index 630b048..4ea0fa5 100644
--- a/coreutils/Kbuild.src
+++ b/coreutils/Kbuild.src
@@ -74,7 +74,6 @@ lib-$(CONFIG_SYNC) += sync.o
lib-$(CONFIG_TAC) += tac.o
lib-$(CONFIG_TAIL) += tail.o
lib-$(CONFIG_TEE) += tee.o
-lib-$(CONFIG_TOUCH) += touch.o
lib-$(CONFIG_TRUE) += true.o
lib-$(CONFIG_TTY) += tty.o
lib-$(CONFIG_UNAME) += uname.o
diff --git a/coreutils/touch.c b/coreutils/touch.c
index afff36b..3521771 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -19,6 +19,35 @@
#include "libbb.h"
+//config:config TOUCH
+//config: bool "touch"
+//config: default y
+//config: help
+//config: touch is used to create or change the access and/or
+//config: modification timestamp of specified files.
+
+//applet:IF_TOUCH(APPLET_NOFORK(touch, touch, _BB_DIR_BIN, _BB_SUID_DROP, touch))
+
+//kbuild:lib-$(CONFIG_TOUCH) += touch.o
+
+//usage:#define touch_trivial_usage
+//usage: "[-c]" IF_DESKTOP(" [-d DATE] [-r FILE]") " FILE [FILE]..."
+//usage:#define touch_full_usage "\n\n"
+//usage: "Update the last-modified date on the given FILE[s]\n"
+//usage: "\nOptions:"
+//usage: "\n -c Don't create files"
+//usage: IF_DESKTOP(
+//usage: "\n -d DT Date/time to use"
+//usage: "\n -r FILE Use FILE's date/time"
+//usage: )
+//usage:
+//usage:#define touch_example_usage
+//usage: "$ ls -l /tmp/foo\n"
+//usage: "/bin/ls: /tmp/foo: No such file or directory\n"
+//usage: "$ touch /tmp/foo\n"
+//usage: "$ ls -l /tmp/foo\n"
+//usage: "-rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo\n"
+
/* This is a NOFORK applet. Be very careful! */
/* coreutils implements: