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

Merge pull request #2466 from deantvv/arch-uresult

arch: use UResult
This commit is contained in:
Sylvestre Ledru 2021-06-29 22:29:19 +02:00 committed by GitHub
commit 01f687f09f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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> {