From 14c62cc5e392b193268c8dd1eb5d5bb5d723e915 Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Mon, 27 Dec 2021 18:30:57 -0500 Subject: [PATCH] logname: return UResult from uumain() function --- src/uu/logname/src/logname.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/uu/logname/src/logname.rs b/src/uu/logname/src/logname.rs index 56866ff62..927753932 100644 --- a/src/uu/logname/src/logname.rs +++ b/src/uu/logname/src/logname.rs @@ -12,10 +12,10 @@ #[macro_use] extern crate uucore; -use std::ffi::CStr; -use uucore::InvalidEncodingHandling; - use clap::{crate_version, App}; +use std::ffi::CStr; +use uucore::error::UResult; +use uucore::InvalidEncodingHandling; extern "C" { // POSIX requires using getlogin (or equivalent code) @@ -39,7 +39,8 @@ fn usage() -> &'static str { uucore::execution_phrase() } -pub fn uumain(args: impl uucore::Args) -> i32 { +#[uucore_procs::gen_uumain] +pub fn uumain(args: impl uucore::Args) -> UResult<()> { let args = args .collect_str(InvalidEncodingHandling::Ignore) .accept_any(); @@ -51,7 +52,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 { None => show_error!("no login name"), } - 0 + Ok(()) } pub fn uu_app() -> App<'static, 'static> {