File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,11 @@ fn execute_set(context: &mut ShellCommandContext) -> ExecuteResult {
5454 i += 1 ;
5555 }
5656 } else {
57- // Unknown argument
58- i += 1 ;
57+ // unknown argument
58+ let _ = context
59+ . stderr
60+ . write_line ( & format ! ( "set: invalid option: {}" , arg) ) ;
61+ return ExecuteResult :: from_exit_code ( 1 ) ;
5962 }
6063 }
6164
Original file line number Diff line number Diff line change @@ -2002,6 +2002,14 @@ async fn pipefail_option() {
20022002 . assert_exit_code ( 1 )
20032003 . run ( )
20042004 . await ;
2005+
2006+ // invalid argument
2007+ TestBuilder :: new ( )
2008+ . command ( "set -x" )
2009+ . assert_stderr ( "set: invalid option: -x\n " )
2010+ . assert_exit_code ( 1 )
2011+ . run ( )
2012+ . await ;
20052013}
20062014
20072015#[ tokio:: test]
You can’t perform that action at this time.
0 commit comments