File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 10
10
11
11
// spell-checker:ignore (ToDO) nodename kernelname kernelrelease kernelversion sysname hwplatform mnrsv
12
12
13
- #[ macro_use]
14
- extern crate uucore;
15
-
16
13
use clap:: { crate_version, App , Arg } ;
17
14
use platform_info:: * ;
15
+ use uucore:: error:: { FromIo , UResult } ;
18
16
19
17
const ABOUT : & str = "Print certain system information. With no OPTION, same as -s." ;
20
18
@@ -49,11 +47,13 @@ const HOST_OS: &str = "Fuchsia";
49
47
#[ cfg( target_os = "redox" ) ]
50
48
const HOST_OS : & str = "Redox" ;
51
49
52
- pub fn uumain ( args : impl uucore:: Args ) -> i32 {
50
+ #[ uucore_procs:: gen_uumain]
51
+ pub fn uumain ( args : impl uucore:: Args ) -> UResult < ( ) > {
53
52
let usage = format ! ( "{} [OPTION]..." , uucore:: execution_phrase( ) ) ;
54
53
let matches = uu_app ( ) . usage ( & usage[ ..] ) . get_matches_from ( args) ;
55
54
56
- let uname = crash_if_err ! ( 1 , PlatformInfo :: new( ) ) ;
55
+ let uname =
56
+ PlatformInfo :: new ( ) . map_err_context ( || "failed to create PlatformInfo" . to_string ( ) ) ?;
57
57
let mut output = String :: new ( ) ;
58
58
59
59
let all = matches. is_present ( options:: ALL ) ;
@@ -115,7 +115,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
115
115
}
116
116
println ! ( "{}" , output. trim_end( ) ) ;
117
117
118
- 0
118
+ Ok ( ( ) )
119
119
}
120
120
121
121
pub fn uu_app ( ) -> App < ' static , ' static > {
You can’t perform that action at this time.
0 commit comments