mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-15 09:41:07 +00:00
Merge pull request #2797 from jfinkels/factor-uresult
factor: return UResult from uumain() function
This commit is contained in:
commit
2fa0c55a6e
1 changed files with 4 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ mod factor;
|
|||
use clap::{crate_version, App, Arg};
|
||||
pub use factor::*;
|
||||
use uucore::display::Quotable;
|
||||
use uucore::error::UResult;
|
||||
|
||||
mod miller_rabin;
|
||||
pub mod numeric;
|
||||
|
|
@ -43,7 +44,8 @@ fn print_factors_str(
|
|||
})
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
#[uucore_procs::gen_uumain]
|
||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
let matches = uu_app().get_matches_from(args);
|
||||
let stdout = stdout();
|
||||
// We use a smaller buffer here to pass a gnu test. 4KiB appears to be the default pipe size for bash.
|
||||
|
|
@ -72,7 +74,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
show_error!("{}", e);
|
||||
}
|
||||
|
||||
0
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue