I assume it's actually meaningful on BSD/macOS and makes them behave
like us, but I don't have access to a Mac to test that theory.
---
 toys/posix/touch.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/toys/posix/touch.c b/toys/posix/touch.c
index 5e5588b..6a07ff3 100644
--- a/toys/posix/touch.c
+++ b/toys/posix/touch.c
@@ -3,8 +3,11 @@
  * Copyright 2012 Choubey Ji <[email protected]>
  *
  * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html
+ *
+ * -f is ignored for BSD/macOS compatibility. busybox/coreutils also support
+ * this, but only coreutils documents it in --help output.

-USE_TOUCH(NEWTOY(touch, "<1acd:mr:t:h[!dtr]", TOYFLAG_BIN))
+USE_TOUCH(NEWTOY(touch, "<1acd:fmr:t:h[!dtr]", TOYFLAG_BIN))

 config TOUCH
   bool "touch"
-- 
2.19.1.930.g4563a0d9d0-goog
From 61026d902210d344533d2840e404790d55a33b7a Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Tue, 13 Nov 2018 13:34:21 -0800
Subject: [PATCH] touch: ignore -f like everyone else.

I assume it's actually meaningful on BSD/macOS and makes them behave
like us, but I don't have access to a Mac to test that theory.
---
 toys/posix/touch.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/toys/posix/touch.c b/toys/posix/touch.c
index 5e5588b..6a07ff3 100644
--- a/toys/posix/touch.c
+++ b/toys/posix/touch.c
@@ -3,8 +3,11 @@
  * Copyright 2012 Choubey Ji <[email protected]>
  *
  * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html
+ *
+ * -f is ignored for BSD/macOS compatibility. busybox/coreutils also support
+ * this, but only coreutils documents it in --help output.
 
-USE_TOUCH(NEWTOY(touch, "<1acd:mr:t:h[!dtr]", TOYFLAG_BIN))
+USE_TOUCH(NEWTOY(touch, "<1acd:fmr:t:h[!dtr]", TOYFLAG_BIN))
 
 config TOUCH
   bool "touch"
-- 
2.19.1.930.g4563a0d9d0-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to