mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 13:37:48 +00:00
commit
d286c3ba4b
1 changed files with 5 additions and 3 deletions
|
@ -15,6 +15,7 @@ use std::path::Path;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use strum_macros::{AsRefStr, EnumString};
|
use strum_macros::{AsRefStr, EnumString};
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
|
use uucore::error::{UResult, USimpleError};
|
||||||
|
|
||||||
static ABOUT: &str = "Report or omit repeated lines.";
|
static ABOUT: &str = "Report or omit repeated lines.";
|
||||||
pub mod options {
|
pub mod options {
|
||||||
|
@ -245,7 +246,8 @@ fn get_long_usage() -> String {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
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 long_usage = get_long_usage();
|
let long_usage = get_long_usage();
|
||||||
|
|
||||||
|
@ -265,7 +267,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
2 => (files[0].clone(), files[1].clone()),
|
2 => (files[0].clone(), files[1].clone()),
|
||||||
_ => {
|
_ => {
|
||||||
// Cannot happen as clap will fail earlier
|
// Cannot happen as clap will fail earlier
|
||||||
crash!(1, "Extra operand: {}", files[2]);
|
return Err(USimpleError::new(1, format!("Extra operand: {}", files[2])));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -288,7 +290,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
&mut open_output_file(out_file_name),
|
&mut open_output_file(out_file_name),
|
||||||
);
|
);
|
||||||
|
|
||||||
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