mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
cat: ignore -u flag, just like GNU does
This commit is contained in:
parent
472b56f0ff
commit
cd70d7dec1
2 changed files with 18 additions and 0 deletions
|
@ -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]
|
||||
|
@ -301,6 +302,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<R: FdReadable>(
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue