File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,10 +85,10 @@ fn main() {
8585
8686 match util {
8787 "--list" => {
88- // If --help is also present, show usage instead of list
89- if args. any ( |arg| arg == "--help" || arg == "-h" ) {
90- usage ( & utils , binary_as_util ) ;
91- process:: exit ( 0 ) ;
88+ // we should fail with additional args https://github.com/uutils/coreutils/issues/11383#issuecomment-4082564058
89+ if args. next ( ) . is_some ( ) {
90+ let _ = writeln ! ( io :: stderr ( ) , "coreutils: invalid argument" ) ;
91+ process:: exit ( 1 ) ;
9292 }
9393 let mut out = io:: stdout ( ) . lock ( ) ;
9494 for util in utils. keys ( ) {
@@ -156,8 +156,13 @@ fn main() {
156156 }
157157 }
158158 } else {
159- // no arguments provided
160- usage ( & utils, binary_as_util) ;
161- process:: exit ( 0 ) ;
159+ // GNU just fails, but busybox tests needs usage
160+ // todo: patch the test suite instead
161+ if binary_as_util. ends_with ( "box" ) {
162+ usage ( & utils, binary_as_util) ;
163+ } else {
164+ let _ = writeln ! ( io:: stderr( ) , "coreutils: missing argument" ) ;
165+ }
166+ process:: exit ( 1 ) ;
162167 }
163168}
You can’t perform that action at this time.
0 commit comments