@@ -7,36 +7,26 @@ fn main() {
77
88 args. remove ( 0 ) ;
99
10- let pos_help = args. iter ( ) . position ( |n| n == "--help" ) ;
11- let pos_version = args. iter ( ) . position ( |n| n == "--version" ) ;
10+ let pos_help = args. iter ( ) . position ( |n| n == "--help" ) . unwrap_or ( usize :: MAX ) ;
11+ let pos_version = args. iter ( ) . position ( |n| n == "--version" ) . unwrap_or ( usize :: MAX ) ;
1212
13- // Begin compatibility with GNU extensions
1413 if pos_help < pos_version {
15- help ( ) ;
14+ println ! ( "Outputs the string provided in the arguments forever. If no string is given, outputs 'y' repeatedly." ) ;
15+ println ! ( "For version information, invoke with --version." ) ;
1616 return ;
1717 }
1818
1919 if pos_help > pos_version {
20- version ( ) ;
20+ println ! ( "yes (Mojavesoft implementation); should be compatible with GNU yes v9.5" ) ;
21+ println ! ( "Copyright November 2025." ) ;
2122 return ;
2223 }
2324
2425 let output_str = if args. len ( ) == 0 {
2526 b"y\n "
2627 } else { joined = args. join ( " " ) + "\n " ; joined. as_bytes ( ) } ;
2728
28- // End compatibility with GNU extensions
2929 let mut io_handle = io:: stdout ( ) . lock ( ) ;
3030 let buf = output_str. repeat ( 4096 ) ;
3131 loop { if io_handle. write_all ( & buf) . is_err ( ) { return ; } }
3232}
33-
34- fn help ( ) {
35- println ! ( "Outputs the string provided in the arguments forever. If no string is given, outputs 'y' repeatedly." ) ;
36- println ! ( "For version information, invoke with --version." ) ;
37- }
38-
39- fn version ( ) {
40- println ! ( "yes (Mojavesoft implementation); should be compatible with GNU yes v9.5" ) ;
41- println ! ( "Copyright November 2025." ) ;
42- }
0 commit comments