diff --git a/src/uu/cat/src/cat.rs b/src/uu/cat/src/cat.rs index b22e19b6384..0e784cf009a 100644 --- a/src/uu/cat/src/cat.rs +++ b/src/uu/cat/src/cat.rs @@ -170,6 +170,7 @@ mod options { pub static SHOW_NONPRINTING_TABS: &str = "t"; pub static SHOW_TABS: &str = "show-tabs"; pub static SHOW_NONPRINTING: &str = "show-nonprinting"; + pub static IGNORED_U: &str = "ignored-u"; } #[uucore::main] @@ -302,6 +303,12 @@ pub fn uu_app() -> Command { .help("use ^ and M- notation, except for LF (\\n) and TAB (\\t)") .action(ArgAction::SetTrue), ) + .arg( + Arg::new(options::IGNORED_U) + .short('u') + .help("(ignored)") + .action(ArgAction::SetTrue), + ) } fn cat_handle( diff --git a/tests/by-util/test_cat.rs b/tests/by-util/test_cat.rs index 1fd829ed90c..89b945b8016 100644 --- a/tests/by-util/test_cat.rs +++ b/tests/by-util/test_cat.rs @@ -612,3 +612,14 @@ fn test_error_loop() { .fails() .stderr_is("cat: 1: Too many levels of symbolic links\n"); } + +#[test] +fn test_u_ignored() { + for same_param in ["-u", "-uu"] { + new_ucmd!() + .arg(same_param) + .pipe_in("hello") + .succeeds() + .stdout_only("hello"); + } +}