1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

arch: use UResult

This commit is contained in:
Dean Li 2021-06-29 19:48:20 +08:00
parent 2428a1ccfb
commit 92bfaea3fa
No known key found for this signature in database
GPG key ID: 4F55BB69D480672A

View file

@ -12,16 +12,18 @@ extern crate uucore;
use platform_info::*;
use clap::{crate_version, App};
use uucore::error::{FromIo, UResult};
static ABOUT: &str = "Display machine architecture";
static SUMMARY: &str = "Determine architecture name for current machine.";
pub fn uumain(args: impl uucore::Args) -> i32 {
#[uucore_procs::gen_uumain]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
uu_app().get_matches_from(args);
let uts = return_if_err!(1, PlatformInfo::new());
let uts = PlatformInfo::new().map_err_context(|| "arch: ".to_string())?;
println!("{}", uts.machine().trim());
0
Ok(())
}
pub fn uu_app() -> App<'static, 'static> {