File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
166166 uu_app ( ) . print_help ( ) ?;
167167 return Ok ( ( ) ) ;
168168 } else if first_arg == "--version" && args. peek ( ) . is_none ( ) {
169- write ! ( stdout( ) , "{}" , uu_app ( ) . render_version ( ) ) ?;
169+ writeln ! ( stdout( ) , "echo {}" , uucore :: crate_version! ( ) ) ?;
170170 return Ok ( ( ) ) ;
171171 }
172172
@@ -186,7 +186,7 @@ pub fn uu_app() -> Command {
186186 // Note: echo is different from the other utils in that it should **not**
187187 // have `infer_long_args(true)`, because, for example, `--ver` should be
188188 // printed as `--ver` and not show the version text.
189- Command :: new ( uucore :: util_name ( ) )
189+ Command :: new ( "echo" )
190190 // TrailingVarArg specifies the final positional argument is a VarArg
191191 // and it doesn't attempts the parse any further args.
192192 // Final argument must have multiple(true) or the usage string equivalent.
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ pub fn uumain(mut args: impl uucore::Args) -> i32 {
1616 let error = if flag == "--help" {
1717 uu_app ( ) . print_help ( )
1818 } else if flag == "--version" {
19- write ! ( std:: io:: stdout( ) , "{}" , uu_app( ) . render_version( ) )
19+ // avoid uu_app for smaller binary size
20+ writeln ! ( std:: io:: stdout( ) , "false {}" , uucore:: crate_version!( ) )
2021 } else {
2122 return 1 ;
2223 } ;
@@ -30,7 +31,7 @@ pub fn uumain(mut args: impl uucore::Args) -> i32 {
3031}
3132
3233pub fn uu_app ( ) -> Command {
33- Command :: new ( uucore :: util_name ( ) )
34+ Command :: new ( "false" )
3435 . version ( uucore:: crate_version!( ) )
3536 . help_template ( uucore:: localized_help_template ( uucore:: util_name ( ) ) )
3637 . about ( translate ! ( "false-about" ) )
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ pub fn uumain(mut args: impl uucore::Args) -> i32 {
1616 let error = if flag == "--help" {
1717 uu_app ( ) . print_help ( )
1818 } else if flag == "--version" {
19- write ! ( std:: io:: stdout( ) , "{}" , uu_app( ) . render_version( ) )
19+ // avoid uu_app for smaller binary size
20+ writeln ! ( std:: io:: stdout( ) , "true {}" , uucore:: crate_version!( ) )
2021 } else {
2122 return 0 ;
2223 } ;
@@ -35,7 +36,7 @@ pub fn uumain(mut args: impl uucore::Args) -> i32 {
3536}
3637
3738pub fn uu_app ( ) -> Command {
38- Command :: new ( uucore :: util_name ( ) )
39+ Command :: new ( "true" )
3940 . version ( uucore:: crate_version!( ) )
4041 . help_template ( uucore:: localized_help_template ( uucore:: util_name ( ) ) )
4142 . about ( translate ! ( "true-about" ) )
You can’t perform that action at this time.
0 commit comments