mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
users: use UResult
This commit is contained in:
parent
00c9710206
commit
e2fa6f9412
1 changed files with 4 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use clap::{crate_version, App, Arg};
|
use clap::{crate_version, App, Arg};
|
||||||
|
use uucore::error::UResult;
|
||||||
use uucore::utmpx::{self, Utmpx};
|
use uucore::utmpx::{self, Utmpx};
|
||||||
|
|
||||||
static ABOUT: &str = "Print the user names of users currently logged in to the current host";
|
static ABOUT: &str = "Print the user names of users currently logged in to the current host";
|
||||||
|
@ -29,7 +30,8 @@ If FILE is not specified, use {}. /var/log/wtmp as FILE is common.",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
#[uucore_procs::gen_uumain]
|
||||||
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let usage = usage();
|
let usage = usage();
|
||||||
let after_help = get_long_usage();
|
let after_help = get_long_usage();
|
||||||
|
|
||||||
|
@ -59,7 +61,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
println!("{}", users.join(" "));
|
println!("{}", users.join(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
0
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uu_app() -> App<'static, 'static> {
|
pub fn uu_app() -> App<'static, 'static> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue