diff --git a/src/uu/cut/src/cut.rs b/src/uu/cut/src/cut.rs index 0555be14f..0d5f79b35 100644 --- a/src/uu/cut/src/cut.rs +++ b/src/uu/cut/src/cut.rs @@ -17,7 +17,7 @@ use uucore::line_ending::LineEnding; use self::searcher::Searcher; use matcher::{ExactMatcher, Matcher, WhitespaceMatcher}; use uucore::ranges::Range; -use uucore::{format_usage, help_about, help_section, help_usage, show, show_error, show_if_err}; +use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_if_err}; mod matcher; mod searcher; diff --git a/src/uu/dd/src/dd.rs b/src/uu/dd/src/dd.rs index 645c24967..b721d1d72 100644 --- a/src/uu/dd/src/dd.rs +++ b/src/uu/dd/src/dd.rs @@ -50,9 +50,9 @@ use uucore::display::Quotable; #[cfg(unix)] use uucore::error::set_exit_code; use uucore::error::{FromIo, UResult}; -use uucore::{format_usage, help_about, help_section, help_usage, show_error}; #[cfg(target_os = "linux")] -use uucore::{show, show_if_err}; +use uucore::show_if_err; +use uucore::{format_usage, help_about, help_section, help_usage, show_error}; const ABOUT: &str = help_about!("dd.md"); const AFTER_HELP: &str = help_section!("after help", "dd.md"); diff --git a/src/uu/head/src/head.rs b/src/uu/head/src/head.rs index 5d0d3bedd..83bdd3739 100644 --- a/src/uu/head/src/head.rs +++ b/src/uu/head/src/head.rs @@ -9,7 +9,7 @@ use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use std::ffi::OsString; use std::io::{self, BufWriter, ErrorKind, Read, Seek, SeekFrom, Write}; use uucore::display::Quotable; -use uucore::error::{FromIo, UError, UResult, USimpleError}; +use uucore::error::{FromIo, UResult, USimpleError}; use uucore::line_ending::LineEnding; use uucore::lines::lines; use uucore::{format_usage, help_about, help_usage, show}; diff --git a/src/uu/kill/src/kill.rs b/src/uu/kill/src/kill.rs index b0e18a798..f353fd7ca 100644 --- a/src/uu/kill/src/kill.rs +++ b/src/uu/kill/src/kill.rs @@ -10,7 +10,7 @@ use nix::sys::signal::{self, Signal}; use nix::unistd::Pid; use std::io::Error; use uucore::display::Quotable; -use uucore::error::{FromIo, UError, UResult, USimpleError}; +use uucore::error::{FromIo, UResult, USimpleError}; use uucore::signals::{signal_by_name_or_value, ALL_SIGNALS}; use uucore::{format_usage, help_about, help_usage, show}; diff --git a/src/uu/mkdir/src/mkdir.rs b/src/uu/mkdir/src/mkdir.rs index 4121278b6..c29905ef4 100644 --- a/src/uu/mkdir/src/mkdir.rs +++ b/src/uu/mkdir/src/mkdir.rs @@ -16,7 +16,7 @@ use uucore::error::{UResult, USimpleError}; #[cfg(not(windows))] use uucore::mode; use uucore::{display::Quotable, fs::dir_strip_dot_for_creation}; -use uucore::{format_usage, help_about, help_section, help_usage, show, show_if_err}; +use uucore::{format_usage, help_about, help_section, help_usage, show_if_err}; static DEFAULT_PERM: u32 = 0o777; diff --git a/src/uu/mv/src/mv.rs b/src/uu/mv/src/mv.rs index 036024f99..60dabf345 100644 --- a/src/uu/mv/src/mv.rs +++ b/src/uu/mv/src/mv.rs @@ -21,7 +21,7 @@ use std::os::windows; use std::path::{Path, PathBuf}; use uucore::backup_control::{self, source_is_target_backup}; use uucore::display::Quotable; -use uucore::error::{set_exit_code, FromIo, UError, UResult, USimpleError, UUsageError}; +use uucore::error::{set_exit_code, FromIo, UResult, USimpleError, UUsageError}; use uucore::fs::{are_hardlinks_or_one_way_symlink_to_same_file, are_hardlinks_to_same_file}; use uucore::update_control; // These are exposed for projects (e.g. nushell) that want to create an `Options` value, which diff --git a/src/uu/numfmt/src/numfmt.rs b/src/uu/numfmt/src/numfmt.rs index d1785209d..d158072fb 100644 --- a/src/uu/numfmt/src/numfmt.rs +++ b/src/uu/numfmt/src/numfmt.rs @@ -13,7 +13,7 @@ use std::str::FromStr; use units::{IEC_BASES, SI_BASES}; use uucore::display::Quotable; -use uucore::error::{UError, UResult}; +use uucore::error::UResult; use uucore::ranges::Range; use uucore::{format_usage, help_about, help_section, help_usage, show, show_error}; diff --git a/src/uu/realpath/src/realpath.rs b/src/uu/realpath/src/realpath.rs index 64806fbab..b099a5f37 100644 --- a/src/uu/realpath/src/realpath.rs +++ b/src/uu/realpath/src/realpath.rs @@ -15,13 +15,13 @@ use std::{ use uucore::fs::make_path_relative_to; use uucore::{ display::{print_verbatim, Quotable}, - error::{FromIo, UResult}, + error::{FromIo, UClapError, UResult}, format_usage, fs::{canonicalize, MissingHandling, ResolveMode}, help_about, help_usage, line_ending::LineEnding, + show_if_err, }; -use uucore::{error::UClapError, show, show_if_err}; static ABOUT: &str = help_about!("realpath.md"); const USAGE: &str = help_usage!("realpath.md"); diff --git a/src/uu/shred/src/shred.rs b/src/uu/shred/src/shred.rs index eb63f0e5f..04f81bf23 100644 --- a/src/uu/shred/src/shred.rs +++ b/src/uu/shred/src/shred.rs @@ -17,7 +17,7 @@ use std::path::{Path, PathBuf}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; use uucore::parse_size::parse_size_u64; -use uucore::{format_usage, help_about, help_section, help_usage, show, show_error, show_if_err}; +use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_if_err}; const ABOUT: &str = help_about!("shred.md"); const USAGE: &str = help_usage!("shred.md"); diff --git a/src/uu/tail/src/tail.rs b/src/uu/tail/src/tail.rs index 0488e0808..edac4b151 100644 --- a/src/uu/tail/src/tail.rs +++ b/src/uu/tail/src/tail.rs @@ -31,7 +31,7 @@ use std::fs::File; use std::io::{self, stdin, stdout, BufRead, BufReader, BufWriter, Read, Seek, SeekFrom, Write}; use std::path::{Path, PathBuf}; use uucore::display::Quotable; -use uucore::error::{get_exit_code, set_exit_code, FromIo, UError, UResult, USimpleError}; +use uucore::error::{get_exit_code, set_exit_code, FromIo, UResult, USimpleError}; use uucore::{show, show_error}; #[uucore::main] diff --git a/src/uu/touch/src/touch.rs b/src/uu/touch/src/touch.rs index d9399a051..51c09801b 100644 --- a/src/uu/touch/src/touch.rs +++ b/src/uu/touch/src/touch.rs @@ -17,7 +17,7 @@ use std::ffi::OsString; use std::fs::{self, File}; use std::path::{Path, PathBuf}; use uucore::display::Quotable; -use uucore::error::{FromIo, UError, UResult, USimpleError}; +use uucore::error::{FromIo, UResult, USimpleError}; use uucore::{format_usage, help_about, help_usage, show}; const ABOUT: &str = help_about!("touch.md"); diff --git a/src/uucore/src/lib/macros.rs b/src/uucore/src/lib/macros.rs index ad86d5308..d1a09c281 100644 --- a/src/uucore/src/lib/macros.rs +++ b/src/uucore/src/lib/macros.rs @@ -91,6 +91,7 @@ pub static UTILITY_IS_SECOND_ARG: AtomicBool = AtomicBool::new(false); #[macro_export] macro_rules! show( ($err:expr) => ({ + use $crate::error::UError; let e = $err; $crate::error::set_exit_code(e.code()); eprintln!("{}: {}", $crate::util_name(), e); @@ -131,7 +132,7 @@ macro_rules! show( macro_rules! show_if_err( ($res:expr) => ({ if let Err(e) = $res { - show!(e); + $crate::show!(e); } }) );