mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
cat: strip errno (#10885)
This commit is contained in:
@@ -19,7 +19,7 @@ use std::os::fd::AsFd;
|
||||
use std::os::unix::fs::FileTypeExt;
|
||||
use thiserror::Error;
|
||||
use uucore::display::Quotable;
|
||||
use uucore::error::UResult;
|
||||
use uucore::error::{UResult, strip_errno};
|
||||
use uucore::translate;
|
||||
use uucore::{fast_inc::fast_inc_one, format_usage};
|
||||
|
||||
@@ -82,7 +82,7 @@ impl LineNumber {
|
||||
#[derive(Error, Debug)]
|
||||
enum CatError {
|
||||
/// Wrapper around `io::Error`
|
||||
#[error("{0}")]
|
||||
#[error("{}", strip_errno(.0))]
|
||||
Io(#[from] io::Error),
|
||||
/// Wrapper around `nix::Error`
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
cat: test_directory3/test_directory4: Is a directory
|
||||
cat: file_which_does_not_exist.txt: No such file or directory (os error 2)
|
||||
cat: file_which_does_not_exist.txt: No such file or directory
|
||||
cat: test_directory3/test_directory5: Is a directory
|
||||
cat: test_directory3/../test_directory3/test_directory5: Is a directory
|
||||
cat: test_directory3: Is a directory
|
||||
|
||||
Reference in New Issue
Block a user