File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ pub mod options {
99
99
pub static NO_CREATE : & str = "no-create" ;
100
100
pub static NO_DEREF : & str = "no-dereference" ;
101
101
pub static TIME : & str = "time" ;
102
+ pub static FORCE : & str = "force" ;
102
103
}
103
104
104
105
static ARG_FILES : & str = "files" ;
@@ -291,6 +292,13 @@ pub fn uu_app() -> Command {
291
292
. value_name ( "STRING" )
292
293
. conflicts_with ( options:: sources:: TIMESTAMP ) ,
293
294
)
295
+ . arg (
296
+ Arg :: new ( options:: FORCE )
297
+ . short ( 'f' )
298
+ . help ( "(ignored)" )
299
+ . hide ( true )
300
+ . action ( ArgAction :: SetTrue ) ,
301
+ )
294
302
. arg (
295
303
Arg :: new ( options:: MODIFICATION )
296
304
. short ( 'm' )
Original file line number Diff line number Diff line change @@ -1006,3 +1006,14 @@ fn test_obsolete_posix_format_with_year() {
1006
1006
assert ! ( at. file_exists( "11111111" ) ) ;
1007
1007
assert ! ( !at. file_exists( "0101000090" ) ) ;
1008
1008
}
1009
+
1010
+ #[ test]
1011
+ fn test_touch_f_option ( ) {
1012
+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
1013
+ let file = "test_f_option.txt" ;
1014
+
1015
+ ucmd. args ( & [ "-f" , file] ) . succeeds ( ) . no_output ( ) ;
1016
+
1017
+ assert ! ( at. file_exists( file) ) ;
1018
+ at. remove ( file) ;
1019
+ }
You can’t perform that action at this time.
0 commit comments