File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ pub fn uu_app() -> Command {
129129 . arg (
130130 Arg :: new ( options:: FOREGROUND )
131131 . long ( options:: FOREGROUND )
132+ . short ( 'f' )
132133 . help (
133134 "when not running timeout directly from a shell prompt, allow \
134135 COMMAND to read from the TTY and get TTY signals; in this mode, \
@@ -148,6 +149,7 @@ pub fn uu_app() -> Command {
148149 . arg (
149150 Arg :: new ( options:: PRESERVE_STATUS )
150151 . long ( options:: PRESERVE_STATUS )
152+ . short ( 'p' )
151153 . help ( "exit with the same status as COMMAND, even when the command times out" )
152154 . action ( ArgAction :: SetTrue ) ,
153155 )
Original file line number Diff line number Diff line change @@ -82,15 +82,28 @@ fn test_command_empty_args() {
8282 . stderr_contains ( "timeout: empty string" ) ;
8383}
8484
85+ #[ test]
86+ fn test_foreground ( ) {
87+ for arg in [ "-f" , "--foreground" ] {
88+ new_ucmd ! ( )
89+ . args ( & [ arg, ".1" , "sleep" , "10" ] )
90+ . fails ( )
91+ . code_is ( 124 )
92+ . no_output ( ) ;
93+ }
94+ }
95+
8596#[ test]
8697fn test_preserve_status ( ) {
87- new_ucmd ! ( )
88- . args ( & [ "--preserve-status" , ".1" , "sleep" , "10" ] )
89- . fails ( )
90- // 128 + SIGTERM = 128 + 15
91- . code_is ( 128 + 15 )
92- . no_stderr ( )
93- . no_stdout ( ) ;
98+ for arg in [ "-p" , "--preserve-status" ] {
99+ new_ucmd ! ( )
100+ . args ( & [ arg, ".1" , "sleep" , "10" ] )
101+ . fails ( )
102+ // 128 + SIGTERM = 128 + 15
103+ . code_is ( 128 + 15 )
104+ . no_stderr ( )
105+ . no_stdout ( ) ;
106+ }
94107}
95108
96109#[ test]
You can’t perform that action at this time.
0 commit comments