diff --git a/src/uu/basename/src/basename.rs b/src/uu/basename/src/basename.rs index 62046a15d..c39c329df 100644 --- a/src/uu/basename/src/basename.rs +++ b/src/uu/basename/src/basename.rs @@ -9,10 +9,10 @@ use clap::{Arg, ArgAction, Command}; use std::path::{PathBuf, is_separator}; use uucore::display::Quotable; use uucore::error::{UResult, UUsageError}; +use uucore::format_usage; use uucore::line_ending::LineEnding; -use uucore::{format_usage, help_about, help_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub static MULTIPLE: &str = "multiple"; diff --git a/src/uu/cat/src/cat.rs b/src/uu/cat/src/cat.rs index d60262e1d..cd89c3bc3 100644 --- a/src/uu/cat/src/cat.rs +++ b/src/uu/cat/src/cat.rs @@ -24,14 +24,13 @@ use thiserror::Error; use uucore::display::Quotable; use uucore::error::UResult; use uucore::fs::FileInformation; -use uucore::{fast_inc::fast_inc_one, format_usage, help_about, help_usage}; +use uucore::locale::get_message; +use uucore::{fast_inc::fast_inc_one, format_usage}; /// Linux splice support #[cfg(any(target_os = "linux", target_os = "android"))] mod splice; -use uucore::locale::{self, get_message}; - // Allocate 32 digits for the line number. // An estimate is that we can print about 1e8 lines/seconds, so 32 digits // would be enough for billions of universe lifetimes. diff --git a/src/uu/chcon/src/chcon.rs b/src/uu/chcon/src/chcon.rs index eaf820d2d..be1bc2d5b 100644 --- a/src/uu/chcon/src/chcon.rs +++ b/src/uu/chcon/src/chcon.rs @@ -8,7 +8,7 @@ use clap::builder::ValueParser; use uucore::error::{UResult, USimpleError, UUsageError}; -use uucore::{display::Quotable, format_usage, help_about, help_usage, show_error, show_warning}; +use uucore::{display::Quotable, format_usage, show_error, show_warning}; use clap::{Arg, ArgAction, Command}; use selinux::{OpaqueSecurityContext, SecurityContext}; @@ -24,7 +24,7 @@ mod fts; use errors::*; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub static HELP: &str = "help"; diff --git a/src/uu/chgrp/src/chgrp.rs b/src/uu/chgrp/src/chgrp.rs index fa5daedb9..0fb048903 100644 --- a/src/uu/chgrp/src/chgrp.rs +++ b/src/uu/chgrp/src/chgrp.rs @@ -8,15 +8,15 @@ use uucore::display::Quotable; pub use uucore::entries; use uucore::error::{FromIo, UResult, USimpleError}; +use uucore::format_usage; use uucore::perms::{GidUidOwnerFilter, IfFrom, chown_base, options}; -use uucore::{format_usage, help_about, help_usage}; use clap::{Arg, ArgAction, ArgMatches, Command}; use std::fs; use std::os::unix::fs::MetadataExt; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; fn parse_gid_from_str(group: &str) -> Result { if let Some(gid_str) = group.strip_prefix(':') { diff --git a/src/uu/chmod/src/chmod.rs b/src/uu/chmod/src/chmod.rs index b899a237c..7367d4b76 100644 --- a/src/uu/chmod/src/chmod.rs +++ b/src/uu/chmod/src/chmod.rs @@ -17,10 +17,9 @@ use uucore::libc::mode_t; #[cfg(not(windows))] use uucore::mode; use uucore::perms::{TraverseSymlinks, configure_symlink_and_recursion}; -use uucore::{format_usage, help_about, help_section, help_usage, show, show_error}; +use uucore::{format_usage, show, show_error}; -use uucore::locale::{self, get_message}; -const LONG_USAGE: &str = help_section!("after help", "chmod.md"); +use uucore::locale::get_message; mod options { pub const HELP: &str = "help"; @@ -93,7 +92,9 @@ fn extract_negative_modes(mut args: impl uucore::Args) -> (Option, Vec UResult<()> { let (parsed_cmode, args) = extract_negative_modes(args.skip(1)); // skip binary name - let matches = uu_app().after_help(LONG_USAGE).try_get_matches_from(args)?; + let matches = uu_app() + .after_help(get_message("chmod-after-help")) + .try_get_matches_from(args)?; let changes = matches.get_flag(options::CHANGES); let quiet = matches.get_flag(options::QUIET); diff --git a/src/uu/chown/src/chown.rs b/src/uu/chown/src/chown.rs index af6cbc843..bf820c11e 100644 --- a/src/uu/chown/src/chown.rs +++ b/src/uu/chown/src/chown.rs @@ -7,8 +7,8 @@ use uucore::display::Quotable; pub use uucore::entries::{self, Group, Locate, Passwd}; +use uucore::format_usage; use uucore::perms::{GidUidOwnerFilter, IfFrom, chown_base, options}; -use uucore::{format_usage, help_about, help_usage}; use uucore::error::{FromIo, UResult, USimpleError}; @@ -17,7 +17,7 @@ use clap::{Arg, ArgAction, ArgMatches, Command}; use std::fs; use std::os::unix::fs::MetadataExt; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; fn parse_gid_uid_and_filter(matches: &ArgMatches) -> UResult { let filter = if let Some(spec) = matches.get_one::(options::FROM) { diff --git a/src/uu/chroot/src/chroot.rs b/src/uu/chroot/src/chroot.rs index 48c5de17b..0b04e79ae 100644 --- a/src/uu/chroot/src/chroot.rs +++ b/src/uu/chroot/src/chroot.rs @@ -17,10 +17,9 @@ use uucore::entries::{Locate, Passwd, grp2gid, usr2uid}; use uucore::error::{UClapError, UResult, UUsageError, set_exit_code}; use uucore::fs::{MissingHandling, ResolveMode, canonicalize}; use uucore::libc::{self, chroot, setgid, setgroups, setuid}; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; -use uucore::locale::{self, get_message}; -static USAGE: &str = help_usage!("chroot.md"); +use uucore::locale::get_message; mod options { pub const NEWROOT: &str = "newroot"; diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index 053257997..0ded6c634 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -17,17 +17,16 @@ use uucore::checksum::{ ChecksumVerbose, SUPPORTED_ALGORITHMS, calculate_blake2b_length, detect_algo, digest_reader, perform_checksum_validation, }; +use uucore::locale::get_message; use uucore::{ encoding, error::{FromIo, UResult, USimpleError}, - format_usage, help_about, help_section, help_usage, + format_usage, line_ending::LineEnding, os_str_as_bytes, show, sum::Digest, }; -use uucore::locale::{self, get_message}; - #[derive(Debug, PartialEq)] enum OutputFormat { Hexadecimal, diff --git a/src/uu/comm/src/comm.rs b/src/uu/comm/src/comm.rs index c67b8665a..d595b463d 100644 --- a/src/uu/comm/src/comm.rs +++ b/src/uu/comm/src/comm.rs @@ -9,13 +9,13 @@ use std::cmp::Ordering; use std::fs::{File, metadata}; use std::io::{self, BufRead, BufReader, Read, Stdin, stdin}; use uucore::error::{FromIo, UResult, USimpleError}; +use uucore::format_usage; use uucore::fs::paths_refer_to_same_file; use uucore::line_ending::LineEnding; -use uucore::{format_usage, help_about, help_usage}; use clap::{Arg, ArgAction, ArgMatches, Command}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const COLUMN_1: &str = "1"; diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 37c2367cd..d2966c5c4 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -36,11 +36,12 @@ use uucore::{backup_control, update_control}; // requires these enum. pub use uucore::{backup_control::BackupMode, update_control::UpdateMode}; use uucore::{ - format_usage, help_about, help_section, help_usage, - parser::shortcut_value_parser::ShortcutValueParser, prompt_yes, show_error, show_warning, + format_usage, parser::shortcut_value_parser::ShortcutValueParser, prompt_yes, show_error, + show_warning, }; use crate::copydir::copy_directory; +use uucore::locale::get_message; mod copydir; mod platform; @@ -451,8 +452,6 @@ fn show_debug(copy_debug: &CopyDebug) { ); } -use uucore::locale::{self, get_message}; - static EXIT_ERR: i32 = 1; // Argument constants diff --git a/src/uu/csplit/src/csplit.rs b/src/uu/csplit/src/csplit.rs index ed025da62..5b2478ccd 100644 --- a/src/uu/csplit/src/csplit.rs +++ b/src/uu/csplit/src/csplit.rs @@ -16,7 +16,7 @@ use clap::{Arg, ArgAction, ArgMatches, Command}; use regex::Regex; use uucore::display::Quotable; use uucore::error::{FromIo, UResult}; -use uucore::{format_usage, help_about, help_section, help_usage}; +use uucore::format_usage; mod csplit_error; mod patterns; @@ -25,7 +25,7 @@ mod split_name; use crate::csplit_error::CsplitError; use crate::split_name::SplitName; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const SUFFIX_FORMAT: &str = "suffix-format"; diff --git a/src/uu/cut/src/cut.rs b/src/uu/cut/src/cut.rs index 4d9241b68..19d5d7c0a 100644 --- a/src/uu/cut/src/cut.rs +++ b/src/uu/cut/src/cut.rs @@ -18,14 +18,13 @@ use uucore::os_str_as_bytes; use self::searcher::Searcher; use matcher::{ExactMatcher, Matcher, WhitespaceMatcher}; +use uucore::locale::get_message; use uucore::ranges::Range; -use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_if_err}; +use uucore::{format_usage, show_error, show_if_err}; mod matcher; mod searcher; -use uucore::locale::{self, get_message}; - struct Options<'a> { out_delimiter: Option<&'a [u8]>, line_ending: LineEnding, diff --git a/src/uu/date/src/date.rs b/src/uu/date/src/date.rs index a2e5be2d0..9f8b4c095 100644 --- a/src/uu/date/src/date.rs +++ b/src/uu/date/src/date.rs @@ -17,10 +17,11 @@ use std::path::PathBuf; use uucore::display::Quotable; use uucore::error::FromIo; use uucore::error::{UResult, USimpleError}; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; #[cfg(windows)] use windows_sys::Win32::{Foundation::SYSTEMTIME, System::SystemInformation::SetSystemTime}; +use uucore::locale::get_message; use uucore::parser::shortcut_value_parser::ShortcutValueParser; // Options @@ -30,8 +31,6 @@ const MINUTES: &str = "minutes"; const SECONDS: &str = "seconds"; const NS: &str = "ns"; -use uucore::locale::{self, get_message}; - const OPT_DATE: &str = "date"; const OPT_FORMAT: &str = "format"; const OPT_FILE: &str = "file"; diff --git a/src/uu/dd/src/dd.rs b/src/uu/dd/src/dd.rs index 3c1d1e428..c0e37263f 100644 --- a/src/uu/dd/src/dd.rs +++ b/src/uu/dd/src/dd.rs @@ -60,9 +60,9 @@ use uucore::error::{FromIo, UResult}; use uucore::error::{USimpleError, set_exit_code}; #[cfg(target_os = "linux")] use uucore::show_if_err; -use uucore::{format_usage, help_about, help_section, help_usage, show_error}; +use uucore::{format_usage, show_error}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const BUF_INIT_BYTE: u8 = 0xDD; /// Final settings after parsing diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index c5d1a5aa4..c346cf163 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -15,7 +15,7 @@ use uucore::display::Quotable; use uucore::error::{UError, UResult, USimpleError, get_exit_code}; use uucore::fsext::{MountInfo, read_fs_list}; use uucore::parser::parse_size::ParseSizeError; -use uucore::{format_usage, help_about, help_section, help_usage, show}; +use uucore::{format_usage, show}; use clap::{Arg, ArgAction, ArgMatches, Command, parser::ValueSource}; @@ -29,7 +29,7 @@ use crate::filesystem::Filesystem; use crate::filesystem::FsError; use crate::table::Table; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; static OPT_HELP: &str = "help"; static OPT_ALL: &str = "all"; diff --git a/src/uu/dircolors/src/dircolors.rs b/src/uu/dircolors/src/dircolors.rs index ea5d50825..ae9b76177 100644 --- a/src/uu/dircolors/src/dircolors.rs +++ b/src/uu/dircolors/src/dircolors.rs @@ -16,7 +16,8 @@ use clap::{Arg, ArgAction, Command}; use uucore::colors::{FILE_ATTRIBUTE_CODES, FILE_COLORS, FILE_TYPES, TERMS}; use uucore::display::Quotable; use uucore::error::{UResult, USimpleError, UUsageError}; -use uucore::{format_usage, help_about, help_section, help_usage, parser::parse_glob}; +use uucore::locale::get_message; +use uucore::{format_usage, parser::parse_glob}; mod options { pub const BOURNE_SHELL: &str = "bourne-shell"; @@ -26,8 +27,6 @@ mod options { pub const FILE: &str = "FILE"; } -use uucore::locale::{self, get_message}; - #[derive(PartialEq, Eq, Debug)] pub enum OutputFmt { Shell, diff --git a/src/uu/dirname/src/dirname.rs b/src/uu/dirname/src/dirname.rs index 5eb6ca4b3..02a6ea938 100644 --- a/src/uu/dirname/src/dirname.rs +++ b/src/uu/dirname/src/dirname.rs @@ -7,10 +7,10 @@ use clap::{Arg, ArgAction, Command}; use std::path::Path; use uucore::display::print_verbatim; use uucore::error::{UResult, UUsageError}; +use uucore::format_usage; use uucore::line_ending::LineEnding; -use uucore::{format_usage, help_about, help_section, help_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const ZERO: &str = "zero"; diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index c25d66f5d..08a7c7b91 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -27,10 +27,11 @@ use thiserror::Error; use uucore::display::{Quotable, print_verbatim}; use uucore::error::{FromIo, UError, UResult, USimpleError, set_exit_code}; use uucore::line_ending::LineEnding; +use uucore::locale::get_message; use uucore::parser::parse_glob; use uucore::parser::parse_size::{ParseSizeError, parse_size_u64}; use uucore::parser::shortcut_value_parser::ShortcutValueParser; -use uucore::{format_usage, help_about, help_section, help_usage, show, show_error, show_warning}; +use uucore::{format_usage, show, show_error, show_warning}; #[cfg(windows)] use windows_sys::Win32::Foundation::HANDLE; #[cfg(windows)] @@ -70,8 +71,6 @@ mod options { pub const FILE: &str = "FILE"; } -use uucore::locale::{self, get_message}; - struct TraversalOptions { all: bool, separate_dirs: bool, diff --git a/src/uu/echo/src/echo.rs b/src/uu/echo/src/echo.rs index b6e699ce2..d1306dd3e 100644 --- a/src/uu/echo/src/echo.rs +++ b/src/uu/echo/src/echo.rs @@ -10,9 +10,9 @@ use std::ffi::{OsStr, OsString}; use std::io::{self, StdoutLock, Write}; use uucore::error::{UResult, USimpleError}; use uucore::format::{FormatChar, OctalParsing, parse_escape_only}; -use uucore::{format_usage, help_about, help_section, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const STRING: &str = "STRING"; diff --git a/src/uu/env/src/env.rs b/src/uu/env/src/env.rs index 0555dbe60..dbf5f1d56 100644 --- a/src/uu/env/src/env.rs +++ b/src/uu/env/src/env.rs @@ -36,7 +36,7 @@ use uucore::error::{ExitCode, UError, UResult, USimpleError, UUsageError}; use uucore::line_ending::LineEnding; #[cfg(unix)] use uucore::signals::signal_by_name_or_value; -use uucore::{format_usage, help_about, help_section, help_usage, show_warning}; +use uucore::{format_usage, show_warning}; use thiserror::Error; @@ -74,7 +74,7 @@ impl From for EnvError { } } -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const IGNORE_ENVIRONMENT: &str = "ignore-environment"; diff --git a/src/uu/expand/src/expand.rs b/src/uu/expand/src/expand.rs index a7cb0928c..2e8d1b296 100644 --- a/src/uu/expand/src/expand.rs +++ b/src/uu/expand/src/expand.rs @@ -16,9 +16,9 @@ use thiserror::Error; use unicode_width::UnicodeWidthChar; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult, set_exit_code}; -use uucore::{format_usage, help_about, help_usage, show_error}; +use uucore::{format_usage, show_error}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub static TABS: &str = "tabs"; diff --git a/src/uu/expr/src/expr.rs b/src/uu/expr/src/expr.rs index 6a4f9487b..e43b5a362 100644 --- a/src/uu/expr/src/expr.rs +++ b/src/uu/expr/src/expr.rs @@ -6,10 +6,11 @@ use clap::{Arg, ArgAction, Command}; use syntax_tree::{AstNode, is_truthy}; use thiserror::Error; +use uucore::locale::get_message; use uucore::{ display::Quotable, error::{UError, UResult}, - format_usage, help_about, help_section, help_usage, + format_usage, }; mod syntax_tree; @@ -67,9 +68,9 @@ impl UError for ExprError { pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(uucore::crate_version!()) - .about(help_about!("expr.md")) - .override_usage(format_usage(help_usage!("expr.md"))) - .after_help(help_section!("after help", "expr.md")) + .about(get_message("expr-about")) + .override_usage(format_usage(&get_message("expr-usage"))) + .after_help(get_message("expr-after-help")) .infer_long_args(true) .disable_help_flag(true) .disable_version_flag(true) diff --git a/src/uu/factor/src/factor.rs b/src/uu/factor/src/factor.rs index f00d05eca..4820190f4 100644 --- a/src/uu/factor/src/factor.rs +++ b/src/uu/factor/src/factor.rs @@ -14,9 +14,9 @@ use num_bigint::BigUint; use num_traits::FromPrimitive; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, set_exit_code}; -use uucore::{format_usage, help_about, help_usage, show_error, show_warning}; +use uucore::{format_usage, show_error, show_warning}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub static EXPONENTS: &str = "exponents"; diff --git a/src/uu/false/src/false.rs b/src/uu/false/src/false.rs index a1e15ba42..b8bf3a825 100644 --- a/src/uu/false/src/false.rs +++ b/src/uu/false/src/false.rs @@ -5,9 +5,8 @@ use clap::{Arg, ArgAction, Command}; use std::{ffi::OsString, io::Write}; use uucore::error::{UResult, set_exit_code}; -use uucore::help_about; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { diff --git a/src/uu/fmt/src/fmt.rs b/src/uu/fmt/src/fmt.rs index f8d5cdfa8..bb79c2c59 100644 --- a/src/uu/fmt/src/fmt.rs +++ b/src/uu/fmt/src/fmt.rs @@ -10,15 +10,15 @@ use std::fs::File; use std::io::{BufReader, BufWriter, Read, Stdout, Write, stdin, stdout}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; use linebreak::break_lines; use parasplit::ParagraphStream; +use uucore::locale::get_message; mod linebreak; mod parasplit; -use uucore::locale::{self, get_message}; const MAX_WIDTH: usize = 2500; const DEFAULT_GOAL: usize = 70; const DEFAULT_WIDTH: usize = 75; diff --git a/src/uu/fold/src/fold.rs b/src/uu/fold/src/fold.rs index 1735c5642..465f96433 100644 --- a/src/uu/fold/src/fold.rs +++ b/src/uu/fold/src/fold.rs @@ -11,12 +11,11 @@ use std::io::{BufRead, BufReader, Read, stdin}; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; +use uucore::locale::get_message; const TAB_WIDTH: usize = 8; -use uucore::locale::{self, get_message}; - mod options { pub const BYTES: &str = "bytes"; pub const SPACES: &str = "spaces"; diff --git a/src/uu/groups/src/groups.rs b/src/uu/groups/src/groups.rs index dc2e7a631..54f5afbe3 100644 --- a/src/uu/groups/src/groups.rs +++ b/src/uu/groups/src/groups.rs @@ -10,15 +10,15 @@ use uucore::{ display::Quotable, entries::{Locate, Passwd, get_groups_gnu, gid2grp}, error::{UError, UResult}, - format_usage, help_about, help_usage, show, + format_usage, show, }; use clap::{Arg, ArgAction, Command}; +use uucore::locale::get_message; mod options { pub const USERS: &str = "USERNAME"; } -use uucore::locale::{self, get_message}; #[derive(Debug, Error)] enum GroupsError { diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index 2a81a0b56..621ec5a0b 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -26,11 +26,11 @@ use uucore::checksum::digest_reader; use uucore::checksum::escape_filename; use uucore::checksum::perform_checksum_validation; use uucore::error::{FromIo, UResult}; +use uucore::format_usage; +use uucore::locale::get_message; use uucore::sum::{Digest, Sha3_224, Sha3_256, Sha3_384, Sha3_512, Shake128, Shake256}; -use uucore::{format_usage, help_about, help_usage}; const NAME: &str = "hashsum"; -use uucore::locale::{self, get_message}; struct Options { algoname: &'static str, diff --git a/src/uu/head/src/head.rs b/src/uu/head/src/head.rs index 35fe46112..f6711d960 100644 --- a/src/uu/head/src/head.rs +++ b/src/uu/head/src/head.rs @@ -16,12 +16,10 @@ use thiserror::Error; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult}; use uucore::line_ending::LineEnding; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; const BUF_SIZE: usize = 65536; -use uucore::locale::{self, get_message}; - mod options { pub const BYTES_NAME: &str = "BYTES"; pub const LINES_NAME: &str = "LINES"; @@ -37,6 +35,7 @@ mod take; use take::copy_all_but_n_bytes; use take::copy_all_but_n_lines; use take::take_lines; +use uucore::locale::get_message; #[derive(Error, Debug)] enum HeadError { diff --git a/src/uu/hostid/src/hostid.rs b/src/uu/hostid/src/hostid.rs index cee59b7b0..aa29bd8fa 100644 --- a/src/uu/hostid/src/hostid.rs +++ b/src/uu/hostid/src/hostid.rs @@ -7,9 +7,9 @@ use clap::Command; use libc::{c_long, gethostid}; -use uucore::{error::UResult, format_usage, help_about, help_usage}; +use uucore::{error::UResult, format_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { diff --git a/src/uu/hostname/src/hostname.rs b/src/uu/hostname/src/hostname.rs index 514e3db1f..05252883e 100644 --- a/src/uu/hostname/src/hostname.rs +++ b/src/uu/hostname/src/hostname.rs @@ -15,14 +15,13 @@ use clap::{Arg, ArgAction, ArgMatches, Command}; #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] use dns_lookup::lookup_host; +use uucore::locale::get_message; use uucore::{ error::{FromIo, UResult}, - format_usage, help_about, help_usage, + format_usage, }; -use uucore::locale::{self, get_message}; - static OPT_DOMAIN: &str = "domain"; static OPT_IP_ADDRESS: &str = "ip-address"; static OPT_FQDN: &str = "fqdn"; diff --git a/src/uu/id/src/id.rs b/src/uu/id/src/id.rs index 413ba06b3..a08314748 100644 --- a/src/uu/id/src/id.rs +++ b/src/uu/id/src/id.rs @@ -42,8 +42,9 @@ use uucore::error::{USimpleError, set_exit_code}; pub use uucore::libc; use uucore::libc::{getlogin, uid_t}; use uucore::line_ending::LineEnding; +use uucore::locale::get_message; use uucore::process::{getegid, geteuid, getgid, getuid}; -use uucore::{format_usage, help_about, help_section, help_usage, show_error}; +use uucore::{format_usage, show_error}; macro_rules! cstr2cow { ($v:expr) => { @@ -59,8 +60,6 @@ macro_rules! cstr2cow { }; } -use uucore::locale::{self, get_message}; - #[cfg(not(feature = "selinux"))] static CONTEXT_HELP_TEXT: &str = "print only the security context of the process (not enabled)"; #[cfg(feature = "selinux")] diff --git a/src/uu/install/src/install.rs b/src/uu/install/src/install.rs index 3bfd542c1..4d93a3fc4 100644 --- a/src/uu/install/src/install.rs +++ b/src/uu/install/src/install.rs @@ -27,12 +27,13 @@ use uucore::perms::{Verbosity, VerbosityLevel, wrap_chown}; use uucore::process::{getegid, geteuid}; #[cfg(feature = "selinux")] use uucore::selinux::{contexts_differ, set_selinux_security_context}; -use uucore::{format_usage, help_about, help_usage, show, show_error, show_if_err}; +use uucore::{format_usage, show, show_error, show_if_err}; #[cfg(unix)] use std::os::unix::fs::{FileTypeExt, MetadataExt}; #[cfg(unix)] use std::os::unix::prelude::OsStrExt; +use uucore::locale::get_message; const DEFAULT_MODE: u32 = 0o755; const DEFAULT_STRIP_PROGRAM: &str = "strip"; @@ -140,8 +141,6 @@ impl Behavior { } } -use uucore::locale::{self, get_message}; - static OPT_COMPARE: &str = "compare"; static OPT_DIRECTORY: &str = "directory"; static OPT_IGNORED: &str = "ignored"; diff --git a/src/uu/join/src/join.rs b/src/uu/join/src/join.rs index 838cce325..e676dadaa 100644 --- a/src/uu/join/src/join.rs +++ b/src/uu/join/src/join.rs @@ -18,10 +18,10 @@ use std::os::unix::ffi::OsStrExt; use thiserror::Error; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult, USimpleError, set_exit_code}; +use uucore::format_usage; use uucore::line_ending::LineEnding; -use uucore::{format_usage, help_about, help_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; #[derive(Debug, Error)] enum JoinError { diff --git a/src/uu/kill/src/kill.rs b/src/uu/kill/src/kill.rs index 8d78edd98..6c67aede9 100644 --- a/src/uu/kill/src/kill.rs +++ b/src/uu/kill/src/kill.rs @@ -12,9 +12,9 @@ use std::io::Error; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; use uucore::signals::{ALL_SIGNALS, signal_by_name_or_value, signal_name_by_value}; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; // When the -l option is selected, the program displays the type of signal related to a certain // value or string. In case of a value, the program should control the lower 8 bits, but there is diff --git a/src/uu/link/src/link.rs b/src/uu/link/src/link.rs index 1fcb0186f..5ff1760ba 100644 --- a/src/uu/link/src/link.rs +++ b/src/uu/link/src/link.rs @@ -9,9 +9,9 @@ use std::fs::hard_link; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub static FILES: &str = "FILES"; diff --git a/src/uu/ln/src/ln.rs b/src/uu/ln/src/ln.rs index ec3c2638e..960085200 100644 --- a/src/uu/ln/src/ln.rs +++ b/src/uu/ln/src/ln.rs @@ -9,7 +9,7 @@ use clap::{Arg, ArgAction, Command}; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult}; use uucore::fs::{make_path_relative_to, paths_refer_to_same_file}; -use uucore::{format_usage, help_about, help_section, help_usage, prompt_yes, show_error}; +use uucore::{format_usage, prompt_yes, show_error}; use std::borrow::Cow; use std::collections::HashSet; @@ -24,6 +24,7 @@ use std::os::windows::fs::{symlink_dir, symlink_file}; use std::path::{Path, PathBuf}; use uucore::backup_control::{self, BackupMode}; use uucore::fs::{MissingHandling, ResolveMode, canonicalize}; +use uucore::locale::get_message; pub struct Settings { overwrite: OverwriteMode, @@ -70,8 +71,6 @@ impl UError for LnError { } } -use uucore::locale::{self, get_message}; - mod options { pub const FORCE: &str = "force"; //pub const DIRECTORY: &str = "directory"; diff --git a/src/uu/logname/src/logname.rs b/src/uu/logname/src/logname.rs index a6cdde7df..1ed1efb5f 100644 --- a/src/uu/logname/src/logname.rs +++ b/src/uu/logname/src/logname.rs @@ -7,7 +7,8 @@ use clap::Command; use std::ffi::CStr; -use uucore::{error::UResult, format_usage, help_about, help_usage, show_error}; +use uucore::locale::get_message; +use uucore::{error::UResult, show_error}; unsafe extern "C" { // POSIX requires using getlogin (or equivalent code) @@ -25,8 +26,6 @@ fn get_userlogin() -> Option { } } -use uucore::locale::{self, get_message}; - #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { let _ = uu_app().try_get_matches_from(args)?; diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 33975b217..f3884f302 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -37,8 +37,11 @@ use jiff::{Timestamp, Zoned}; use lscolors::LsColors; use term_grid::{DEFAULT_SEPARATOR_SIZE, Direction, Filling, Grid, GridOptions, SPACES_IN_TAB}; use thiserror::Error; +#[cfg(unix)] +use uucore::entries; use uucore::error::USimpleError; use uucore::format::human::{SizeFormat, human_readable}; +use uucore::fs::FileInformation; #[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))] use uucore::fsxattr::has_acl; #[cfg(unix)] @@ -57,6 +60,7 @@ use uucore::libc::{S_IXGRP, S_IXOTH, S_IXUSR}; ))] use uucore::libc::{dev_t, major, minor}; use uucore::line_ending::LineEnding; +use uucore::locale::get_message; use uucore::quoting_style::{self, QuotingStyle, escape_name}; use uucore::{ display::Quotable, @@ -68,9 +72,7 @@ use uucore::{ parser::shortcut_value_parser::ShortcutValueParser, version_cmp::version_cmp, }; -use uucore::{ - help_about, help_section, help_usage, parser::parse_glob, show, show_error, show_warning, -}; +use uucore::{parser::parse_glob, show, show_error, show_warning}; mod dired; use dired::{DiredOutput, is_dired_arg_present}; @@ -82,8 +84,6 @@ static CONTEXT_HELP_TEXT: &str = "print any security context of each file (not e #[cfg(feature = "selinux")] static CONTEXT_HELP_TEXT: &str = "print any security context of each file"; -use uucore::locale::{self, get_message}; - pub mod options { pub mod format { pub static ONE_LINE: &str = "1"; @@ -3014,10 +3014,6 @@ fn get_inode(metadata: &Metadata) -> String { // Currently getpwuid is `linux` target only. If it's broken state.out into // a posix-compliant attribute this can be updated... -#[cfg(unix)] -use uucore::entries; -use uucore::fs::FileInformation; - #[cfg(unix)] fn display_uname<'a>(metadata: &Metadata, config: &Config, state: &'a mut ListState) -> &'a String { let uid = metadata.uid(); diff --git a/src/uu/mkdir/src/mkdir.rs b/src/uu/mkdir/src/mkdir.rs index 6c181e55f..7fceb36ce 100644 --- a/src/uu/mkdir/src/mkdir.rs +++ b/src/uu/mkdir/src/mkdir.rs @@ -13,15 +13,14 @@ use std::path::{Path, PathBuf}; #[cfg(not(windows))] use uucore::error::FromIo; use uucore::error::{UResult, USimpleError}; +use uucore::locale::get_message; #[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_if_err}; +use uucore::{format_usage, show_if_err}; static DEFAULT_PERM: u32 = 0o777; -use uucore::locale::{self, get_message}; - mod options { pub const MODE: &str = "mode"; pub const PARENTS: &str = "parents"; diff --git a/src/uu/mkfifo/src/mkfifo.rs b/src/uu/mkfifo/src/mkfifo.rs index 7d3df867d..ea5880438 100644 --- a/src/uu/mkfifo/src/mkfifo.rs +++ b/src/uu/mkfifo/src/mkfifo.rs @@ -10,10 +10,9 @@ use std::fs; use std::os::unix::fs::PermissionsExt; use uucore::display::Quotable; use uucore::error::{UResult, USimpleError}; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; -static USAGE: &str = help_usage!("mkfifo.md"); -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub static MODE: &str = "mode"; diff --git a/src/uu/mknod/src/mknod.rs b/src/uu/mknod/src/mknod.rs index 801b2256a..94aa043ca 100644 --- a/src/uu/mknod/src/mknod.rs +++ b/src/uu/mknod/src/mknod.rs @@ -12,9 +12,9 @@ use std::ffi::CString; use uucore::display::Quotable; use uucore::error::{UResult, USimpleError, UUsageError, set_exit_code}; -use uucore::{format_usage, help_about, help_section, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const MODE_RW_UGO: mode_t = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; diff --git a/src/uu/mktemp/src/mktemp.rs b/src/uu/mktemp/src/mktemp.rs index 21f61660f..ec6495084 100644 --- a/src/uu/mktemp/src/mktemp.rs +++ b/src/uu/mktemp/src/mktemp.rs @@ -8,7 +8,7 @@ use clap::{Arg, ArgAction, ArgMatches, Command, builder::ValueParser}; use uucore::display::{Quotable, println_verbatim}; use uucore::error::{FromIo, UError, UResult, UUsageError}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; use std::env; use std::ffi::OsStr; @@ -25,7 +25,7 @@ use rand::Rng; use tempfile::Builder; use thiserror::Error; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; static DEFAULT_TEMPLATE: &str = "tmp.XXXXXXXXXX"; diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index c07846d19..fc2689448 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -23,10 +23,10 @@ use crossterm::{ }; use uucore::error::{UResult, USimpleError, UUsageError}; +use uucore::format_usage; use uucore::{display::Quotable, show}; -use uucore::{format_usage, help_about, help_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const BELL: char = '\x07'; // Printing this character will ring the bell // The prompt to be displayed at the top of the screen when viewing multiple files, diff --git a/src/uu/mv/src/mv.rs b/src/uu/mv/src/mv.rs index 195c79e11..0b7e56d53 100644 --- a/src/uu/mv/src/mv.rs +++ b/src/uu/mv/src/mv.rs @@ -40,7 +40,7 @@ use uucore::update_control; // These are exposed for projects (e.g. nushell) that want to create an `Options` value, which // requires these enums pub use uucore::{backup_control::BackupMode, update_control::UpdateMode}; -use uucore::{format_usage, help_about, help_section, help_usage, prompt_yes, show}; +use uucore::{format_usage, prompt_yes, show}; use fs_extra::dir::{ CopyOptions as DirCopyOptions, TransitProcess, TransitProcessResult, get_size as dir_get_size, @@ -48,6 +48,7 @@ use fs_extra::dir::{ }; use crate::error::MvError; +use uucore::locale::get_message; /// Options contains all the possible behaviors and flags for mv. /// @@ -123,8 +124,6 @@ pub enum OverwriteMode { Force, } -use uucore::locale::{self, get_message}; - static OPT_FORCE: &str = "force"; static OPT_INTERACTIVE: &str = "interactive"; static OPT_NO_CLOBBER: &str = "no-clobber"; diff --git a/src/uu/nice/src/nice.rs b/src/uu/nice/src/nice.rs index 927d9ad4b..bb86d7778 100644 --- a/src/uu/nice/src/nice.rs +++ b/src/uu/nice/src/nice.rs @@ -11,9 +11,10 @@ use std::io::{Error, Write}; use std::ptr; use clap::{Arg, ArgAction, Command}; +use uucore::locale::get_message; use uucore::{ error::{UClapError, UResult, USimpleError, UUsageError, set_exit_code}, - format_usage, help_about, help_usage, show_error, + format_usage, show_error, }; pub mod options { @@ -21,8 +22,6 @@ pub mod options { pub static COMMAND: &str = "COMMAND"; } -use uucore::locale::{self, get_message}; - fn is_prefix_of(maybe_prefix: &str, target: &str, min_match: usize) -> bool { if maybe_prefix.len() < min_match || maybe_prefix.len() > target.len() { return false; diff --git a/src/uu/nl/src/nl.rs b/src/uu/nl/src/nl.rs index 370d9e780..0b6397dfe 100644 --- a/src/uu/nl/src/nl.rs +++ b/src/uu/nl/src/nl.rs @@ -8,12 +8,11 @@ use std::fs::File; use std::io::{BufRead, BufReader, Read, stdin}; use std::path::Path; use uucore::error::{FromIo, UResult, USimpleError, set_exit_code}; -use uucore::{format_usage, help_about, help_section, help_usage, show_error}; +use uucore::locale::get_message; +use uucore::{format_usage, show_error}; mod helper; -use uucore::locale::{self, get_message}; - // Settings store options used by nl to produce its output. pub struct Settings { // The variables corresponding to the options -h, -b, and -f. diff --git a/src/uu/nohup/src/nohup.rs b/src/uu/nohup/src/nohup.rs index 4fa8ed37e..a855b01f1 100644 --- a/src/uu/nohup/src/nohup.rs +++ b/src/uu/nohup/src/nohup.rs @@ -17,9 +17,9 @@ use std::path::{Path, PathBuf}; use thiserror::Error; use uucore::display::Quotable; use uucore::error::{UClapError, UError, UResult, set_exit_code}; -use uucore::{format_usage, help_about, help_section, help_usage, show_error}; +use uucore::{format_usage, show_error}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; static NOHUP_OUT: &str = "nohup.out"; // exit codes that match the GNU implementation static EXIT_CANCELED: i32 = 125; diff --git a/src/uu/nproc/src/nproc.rs b/src/uu/nproc/src/nproc.rs index 008cd0050..beed92834 100644 --- a/src/uu/nproc/src/nproc.rs +++ b/src/uu/nproc/src/nproc.rs @@ -9,7 +9,8 @@ use clap::{Arg, ArgAction, Command}; use std::{env, thread}; use uucore::display::Quotable; use uucore::error::{UResult, USimpleError}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; +use uucore::locale::get_message; #[cfg(any(target_os = "linux", target_os = "android"))] pub const _SC_NPROCESSORS_CONF: libc::c_int = 83; @@ -23,8 +24,6 @@ pub const _SC_NPROCESSORS_CONF: libc::c_int = 1001; static OPT_ALL: &str = "all"; static OPT_IGNORE: &str = "ignore"; -use uucore::locale::{self, get_message}; - #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { let matches = uu_app().try_get_matches_from(args)?; diff --git a/src/uu/numfmt/src/numfmt.rs b/src/uu/numfmt/src/numfmt.rs index c82ff9453..de977d035 100644 --- a/src/uu/numfmt/src/numfmt.rs +++ b/src/uu/numfmt/src/numfmt.rs @@ -15,17 +15,16 @@ use std::str::FromStr; use units::{IEC_BASES, SI_BASES}; use uucore::display::Quotable; use uucore::error::UResult; +use uucore::locale::get_message; use uucore::parser::shortcut_value_parser::ShortcutValueParser; use uucore::ranges::Range; -use uucore::{format_usage, help_about, help_section, help_usage, show, show_error}; +use uucore::{format_usage, show, show_error}; pub mod errors; pub mod format; pub mod options; mod units; -use uucore::locale::{self, get_message}; - fn handle_args<'a>(args: impl Iterator, options: &NumfmtOptions) -> UResult<()> { for l in args { format_and_handle_validation(l, options)?; diff --git a/src/uu/od/src/od.rs b/src/uu/od/src/od.rs index 1a728c937..a84adece2 100644 --- a/src/uu/od/src/od.rs +++ b/src/uu/od/src/od.rs @@ -44,14 +44,13 @@ use clap::ArgAction; use clap::{Arg, ArgMatches, Command, parser::ValueSource}; use uucore::display::Quotable; use uucore::error::{UResult, USimpleError}; +use uucore::locale::get_message; use uucore::parser::parse_size::ParseSizeError; use uucore::parser::shortcut_value_parser::ShortcutValueParser; -use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_warning}; +use uucore::{format_usage, show_error, show_warning}; const PEEK_BUFFER_SIZE: usize = 4; // utf-8 can be 4 bytes -use uucore::locale::{self, get_message}; - pub(crate) mod options { pub const HELP: &str = "help"; pub const ADDRESS_RADIX: &str = "address-radix"; diff --git a/src/uu/paste/src/paste.rs b/src/uu/paste/src/paste.rs index 64c27384e..9bb94294f 100644 --- a/src/uu/paste/src/paste.rs +++ b/src/uu/paste/src/paste.rs @@ -11,10 +11,10 @@ use std::iter::Cycle; use std::rc::Rc; use std::slice::Iter; use uucore::error::{UResult, USimpleError}; +use uucore::format_usage; use uucore::line_ending::LineEnding; -use uucore::{format_usage, help_about, help_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const DELIMITER: &str = "delimiters"; diff --git a/src/uu/pathchk/src/pathchk.rs b/src/uu/pathchk/src/pathchk.rs index d27df4c51..cdd6418c4 100644 --- a/src/uu/pathchk/src/pathchk.rs +++ b/src/uu/pathchk/src/pathchk.rs @@ -10,7 +10,8 @@ use std::fs; use std::io::{ErrorKind, Write}; use uucore::display::Quotable; use uucore::error::{UResult, UUsageError, set_exit_code}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; +use uucore::locale::get_message; // operating mode enum Mode { @@ -20,8 +21,6 @@ enum Mode { Both, // a combination of `Basic` and `Extra` } -use uucore::locale::{self, get_message}; - mod options { pub const POSIX: &str = "posix"; pub const POSIX_SPECIAL: &str = "posix-special"; diff --git a/src/uu/pinky/src/pinky.rs b/src/uu/pinky/src/pinky.rs index 5b1ea9ddf..2f6876611 100644 --- a/src/uu/pinky/src/pinky.rs +++ b/src/uu/pinky/src/pinky.rs @@ -6,7 +6,7 @@ // spell-checker:ignore (ToDO) BUFSIZE gecos fullname, mesg iobuf use clap::{Arg, ArgAction, Command}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; mod platform; @@ -20,7 +20,7 @@ const ABOUT: &str = concat!( ); #[cfg(not(target_env = "musl"))] -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const LONG_FORMAT: &str = "long_format"; diff --git a/src/uu/pr/src/pr.rs b/src/uu/pr/src/pr.rs index 0741f17c5..4ca97e784 100644 --- a/src/uu/pr/src/pr.rs +++ b/src/uu/pr/src/pr.rs @@ -18,9 +18,9 @@ use thiserror::Error; use uucore::display::Quotable; use uucore::error::UResult; -use uucore::{format_usage, help_about, help_section, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const TAB: char = '\t'; const LINES_PER_PAGE: usize = 66; const LINES_PER_PAGE_FOR_FORM_FEED: usize = 63; diff --git a/src/uu/printenv/src/printenv.rs b/src/uu/printenv/src/printenv.rs index 85925bf8f..15e39a678 100644 --- a/src/uu/printenv/src/printenv.rs +++ b/src/uu/printenv/src/printenv.rs @@ -5,9 +5,9 @@ use clap::{Arg, ArgAction, Command}; use std::env; -use uucore::{error::UResult, format_usage, help_about, help_usage}; +use uucore::{error::UResult, format_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; static OPT_NULL: &str = "null"; diff --git a/src/uu/printf/src/printf.rs b/src/uu/printf/src/printf.rs index bc36305cc..a28fc6aae 100644 --- a/src/uu/printf/src/printf.rs +++ b/src/uu/printf/src/printf.rs @@ -7,11 +7,11 @@ use std::io::stdout; use std::ops::ControlFlow; use uucore::error::{UResult, UUsageError}; use uucore::format::{FormatArgument, FormatArguments, FormatItem, parse_spec_and_escape}; -use uucore::{format_usage, help_about, help_section, help_usage, os_str_as_bytes, show_warning}; +use uucore::locale::get_message; +use uucore::{format_usage, os_str_as_bytes, show_warning}; const VERSION: &str = "version"; const HELP: &str = "help"; -use uucore::locale::{self, get_message}; mod options { pub const FORMAT: &str = "FORMAT"; diff --git a/src/uu/ptx/src/ptx.rs b/src/uu/ptx/src/ptx.rs index 82e7cec52..856183a54 100644 --- a/src/uu/ptx/src/ptx.rs +++ b/src/uu/ptx/src/ptx.rs @@ -17,9 +17,9 @@ use regex::Regex; use thiserror::Error; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult, UUsageError}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; #[derive(Debug)] enum OutFormat { diff --git a/src/uu/pwd/src/pwd.rs b/src/uu/pwd/src/pwd.rs index b7d9ea69d..f1f398d9b 100644 --- a/src/uu/pwd/src/pwd.rs +++ b/src/uu/pwd/src/pwd.rs @@ -8,12 +8,12 @@ use clap::{Arg, Command}; use std::env; use std::io; use std::path::PathBuf; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; use uucore::display::println_verbatim; use uucore::error::{FromIo, UResult}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const OPT_LOGICAL: &str = "logical"; const OPT_PHYSICAL: &str = "physical"; diff --git a/src/uu/readlink/src/readlink.rs b/src/uu/readlink/src/readlink.rs index d05efa610..f41e076a3 100644 --- a/src/uu/readlink/src/readlink.rs +++ b/src/uu/readlink/src/readlink.rs @@ -13,9 +13,9 @@ use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; use uucore::fs::{MissingHandling, ResolveMode, canonicalize}; use uucore::line_ending::LineEnding; -use uucore::{format_usage, help_about, help_usage, show_error}; +use uucore::{format_usage, show_error}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const OPT_CANONICALIZE: &str = "canonicalize"; const OPT_CANONICALIZE_MISSING: &str = "canonicalize-missing"; const OPT_CANONICALIZE_EXISTING: &str = "canonicalize-existing"; diff --git a/src/uu/realpath/src/realpath.rs b/src/uu/realpath/src/realpath.rs index 3a947d9a0..4868ba68a 100644 --- a/src/uu/realpath/src/realpath.rs +++ b/src/uu/realpath/src/realpath.rs @@ -11,18 +11,16 @@ use std::{ path::{Path, PathBuf}, }; use uucore::fs::make_path_relative_to; +use uucore::locale::get_message; use uucore::{ display::{Quotable, print_verbatim}, error::{FromIo, UClapError, UResult}, format_usage, fs::{MissingHandling, ResolveMode, canonicalize}, - help_about, help_usage, line_ending::LineEnding, show_if_err, }; -use uucore::locale::{self, get_message}; - static OPT_QUIET: &str = "quiet"; static OPT_STRIP: &str = "strip"; static OPT_ZERO: &str = "zero"; diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index 367ae04fb..9e07bc077 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -18,9 +18,8 @@ use std::path::MAIN_SEPARATOR; use std::path::{Path, PathBuf}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; -use uucore::{ - format_usage, help_about, help_section, help_usage, os_str_as_bytes, prompt_yes, show_error, -}; +use uucore::locale::get_message; +use uucore::{format_usage, os_str_as_bytes, prompt_yes, show_error}; #[derive(Eq, PartialEq, Clone, Copy)] /// Enum, determining when the `rm` will prompt the user about the file deletion @@ -90,8 +89,6 @@ impl Default for Options { } } -use uucore::locale::{self, get_message}; - static OPT_DIR: &str = "dir"; static OPT_INTERACTIVE: &str = "interactive"; static OPT_FORCE: &str = "force"; diff --git a/src/uu/rmdir/src/rmdir.rs b/src/uu/rmdir/src/rmdir.rs index 8be21e618..228b085ec 100644 --- a/src/uu/rmdir/src/rmdir.rs +++ b/src/uu/rmdir/src/rmdir.rs @@ -14,9 +14,9 @@ use std::path::Path; use uucore::display::Quotable; use uucore::error::{UResult, set_exit_code, strip_errno}; -use uucore::{format_usage, help_about, help_usage, show_error, util_name}; +use uucore::{format_usage, show_error, util_name}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; static OPT_IGNORE_FAIL_NON_EMPTY: &str = "ignore-fail-on-non-empty"; static OPT_PARENTS: &str = "parents"; static OPT_VERBOSE: &str = "verbose"; diff --git a/src/uu/runcon/src/runcon.rs b/src/uu/runcon/src/runcon.rs index 01f692ff3..ee67a9220 100644 --- a/src/uu/runcon/src/runcon.rs +++ b/src/uu/runcon/src/runcon.rs @@ -10,7 +10,7 @@ use uucore::error::{UClapError, UError, UResult}; use clap::{Arg, ArgAction, Command}; use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext}; -use uucore::{format_usage, help_about, help_section, help_usage}; +use uucore::format_usage; use std::borrow::Cow; use std::ffi::{CStr, CString, OsStr, OsString}; @@ -23,8 +23,7 @@ mod errors; use errors::error_exit_status; use errors::{Error, Result, RunconError}; -use uucore::locale::{self, get_message}; -const DESCRIPTION: &str = help_section!("after help", "runcon.md"); +use uucore::locale::get_message; pub mod options { pub const COMPUTE: &str = "compute"; @@ -90,7 +89,7 @@ pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(uucore::crate_version!()) .about(get_message("runcon-about")) - .after_help(DESCRIPTION) + .after_help(get_message("runcon-after-help")) .override_usage(format_usage(&get_message("runcon-usage"))) .infer_long_args(true) .arg( diff --git a/src/uu/seq/src/seq.rs b/src/uu/seq/src/seq.rs index bd7d9b3f2..2dd5f17b8 100644 --- a/src/uu/seq/src/seq.rs +++ b/src/uu/seq/src/seq.rs @@ -15,7 +15,7 @@ use uucore::error::{FromIo, UResult}; use uucore::extendedbigdecimal::ExtendedBigDecimal; use uucore::format::num_format::FloatVariant; use uucore::format::{Format, num_format}; -use uucore::{fast_inc::fast_inc, format_usage, help_about, help_usage}; +use uucore::{fast_inc::fast_inc, format_usage}; mod error; @@ -28,7 +28,7 @@ mod numberparse; use crate::error::SeqError; use crate::number::PreciseNumber; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const OPT_SEPARATOR: &str = "separator"; const OPT_TERMINATOR: &str = "terminator"; diff --git a/src/uu/shred/src/shred.rs b/src/uu/shred/src/shred.rs index d42d652fc..0cfafd862 100644 --- a/src/uu/shred/src/shred.rs +++ b/src/uu/shred/src/shred.rs @@ -18,9 +18,9 @@ use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; use uucore::parser::parse_size::parse_size_u64; use uucore::parser::shortcut_value_parser::ShortcutValueParser; -use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_if_err}; +use uucore::{format_usage, show_error, show_if_err}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub const FORCE: &str = "force"; diff --git a/src/uu/shuf/src/shuf.rs b/src/uu/shuf/src/shuf.rs index 73ee2b371..db4463615 100644 --- a/src/uu/shuf/src/shuf.rs +++ b/src/uu/shuf/src/shuf.rs @@ -19,7 +19,8 @@ use std::path::{Path, PathBuf}; use std::str::FromStr; use uucore::display::{OsWrite, Quotable}; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; +use uucore::locale::get_message; mod rand_read_adapter; @@ -29,9 +30,6 @@ enum Mode { InputRange(RangeInclusive), } -static USAGE: &str = help_usage!("shuf.md"); -use uucore::locale::{self, get_message}; - struct Options { head_count: usize, output: Option, diff --git a/src/uu/sleep/src/sleep.rs b/src/uu/sleep/src/sleep.rs index ff5b9ae2d..9b307b1e8 100644 --- a/src/uu/sleep/src/sleep.rs +++ b/src/uu/sleep/src/sleep.rs @@ -8,15 +8,14 @@ use std::time::Duration; use uucore::{ error::{UResult, USimpleError, UUsageError}, - format_usage, help_about, help_section, help_usage, + format_usage, parser::parse_time, show_error, }; use clap::{Arg, ArgAction, Command}; -use uucore::locale::{self, get_message}; -static AFTER_HELP: &str = help_section!("after help", "sleep.md"); +use uucore::locale::get_message; mod options { pub const NUMBER: &str = "NUMBER"; diff --git a/src/uu/sort/src/sort.rs b/src/uu/sort/src/sort.rs index 06ae5770d..c97d07a6a 100644 --- a/src/uu/sort/src/sort.rs +++ b/src/uu/sort/src/sort.rs @@ -48,11 +48,11 @@ use uucore::line_ending::LineEnding; use uucore::parser::parse_size::{ParseSizeError, Parser}; use uucore::parser::shortcut_value_parser::ShortcutValueParser; use uucore::version_cmp::version_cmp; -use uucore::{format_usage, help_about, help_section, help_usage, show_error}; +use uucore::{format_usage, show_error}; use crate::tmp_dir::TmpDirWrapper; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub mod modes { diff --git a/src/uu/split/src/split.rs b/src/uu/split/src/split.rs index 777cc2479..e026aaa2e 100644 --- a/src/uu/split/src/split.rs +++ b/src/uu/split/src/split.rs @@ -24,8 +24,9 @@ use uucore::display::Quotable; use uucore::error::{FromIo, UIoError, UResult, USimpleError, UUsageError}; use uucore::parser::parse_size::parse_size_u64; +use uucore::format_usage; +use uucore::locale::get_message; use uucore::uio_error; -use uucore::{format_usage, help_about, help_section, help_usage}; static OPT_BYTES: &str = "bytes"; static OPT_LINE_BYTES: &str = "line-bytes"; @@ -46,8 +47,6 @@ static OPT_IO_BLKSIZE: &str = "-io-blksize"; static ARG_INPUT: &str = "input"; static ARG_PREFIX: &str = "prefix"; -use uucore::locale::{self, get_message}; - #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { let (args, obs_lines) = handle_obsolete(args); diff --git a/src/uu/stat/src/stat.rs b/src/uu/stat/src/stat.rs index ca82955b6..2d8871d40 100644 --- a/src/uu/stat/src/stat.rs +++ b/src/uu/stat/src/stat.rs @@ -13,9 +13,7 @@ use uucore::fsext::{ BirthTime, FsMeta, StatFs, pretty_filetype, pretty_fstype, read_fs_list, statfs, }; use uucore::libc::mode_t; -use uucore::{ - entries, format_usage, help_about, help_section, help_usage, show_error, show_warning, -}; +use uucore::{entries, format_usage, show_error, show_warning}; use chrono::{DateTime, Local}; use clap::{Arg, ArgAction, ArgMatches, Command}; @@ -28,8 +26,7 @@ use std::os::unix::prelude::OsStrExt; use std::path::Path; use std::{env, fs}; -use uucore::locale::{self, get_message}; -const LONG_USAGE: &str = help_section!("long usage", "stat.md"); +use uucore::locale::get_message; mod options { pub const DEREFERENCE: &str = "dereference"; @@ -1134,7 +1131,9 @@ impl Stater { #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { - let matches = uu_app().after_help(LONG_USAGE).try_get_matches_from(args)?; + let matches = uu_app() + .after_help(get_message("stat-after-help")) + .try_get_matches_from(args)?; let stater = Stater::new(&matches)?; let exit_status = stater.exec(); diff --git a/src/uu/stdbuf/src/stdbuf.rs b/src/uu/stdbuf/src/stdbuf.rs index 644a5f2ce..9c2698a97 100644 --- a/src/uu/stdbuf/src/stdbuf.rs +++ b/src/uu/stdbuf/src/stdbuf.rs @@ -16,10 +16,8 @@ use tempfile::tempdir; use uucore::error::{FromIo, UClapError, UResult, USimpleError, UUsageError}; use uucore::format_usage; use uucore::parser::parse_size::parse_size_u64; -use uucore::{format_usage, help_about, help_section, help_usage}; -use uucore::locale::{self, get_message}; -const LONG_HELP: &str = help_section!("after help", "stdbuf.md"); +use uucore::locale::get_message; mod options { pub const INPUT: &str = "input"; diff --git a/src/uu/stty/src/stty.rs b/src/uu/stty/src/stty.rs index e60e48cb2..5b5a9948c 100644 --- a/src/uu/stty/src/stty.rs +++ b/src/uu/stty/src/stty.rs @@ -21,8 +21,8 @@ use std::os::fd::{AsFd, BorrowedFd}; use std::os::unix::fs::OpenOptionsExt; use std::os::unix::io::{AsRawFd, RawFd}; use uucore::error::{UResult, USimpleError}; +use uucore::format_usage; use uucore::locale::get_message; -use uucore::{format_usage, help_about, help_usage}; #[cfg(not(any( target_os = "freebsd", diff --git a/src/uu/sum/src/sum.rs b/src/uu/sum/src/sum.rs index 57bdbccc6..0f5e6c664 100644 --- a/src/uu/sum/src/sum.rs +++ b/src/uu/sum/src/sum.rs @@ -11,9 +11,9 @@ use std::io::{ErrorKind, Read, Write, stdin, stdout}; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; fn bsd_sum(mut reader: impl Read) -> std::io::Result<(usize, u16)> { let mut buf = [0; 4096]; diff --git a/src/uu/sync/src/sync.rs b/src/uu/sync/src/sync.rs index 0f45a74a1..47db35c32 100644 --- a/src/uu/sync/src/sync.rs +++ b/src/uu/sync/src/sync.rs @@ -17,9 +17,9 @@ use uucore::display::Quotable; #[cfg(any(target_os = "linux", target_os = "android"))] use uucore::error::FromIo; use uucore::error::{UResult, USimpleError}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub static FILE_SYSTEM: &str = "file-system"; diff --git a/src/uu/tac/src/tac.rs b/src/uu/tac/src/tac.rs index bcad03b13..0cb2009a9 100644 --- a/src/uu/tac/src/tac.rs +++ b/src/uu/tac/src/tac.rs @@ -17,12 +17,11 @@ use std::{ use uucore::display::Quotable; use uucore::error::UError; use uucore::error::UResult; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; use crate::error::TacError; -static USAGE: &str = help_usage!("tac.md"); -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub static BEFORE: &str = "before"; diff --git a/src/uu/tail/src/args.rs b/src/uu/tail/src/args.rs index 329f5c58d..374beffd0 100644 --- a/src/uu/tail/src/args.rs +++ b/src/uu/tail/src/args.rs @@ -16,9 +16,9 @@ use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::parser::parse_size::{ParseSizeError, parse_size_u64}; use uucore::parser::parse_time; use uucore::parser::shortcut_value_parser::ShortcutValueParser; -use uucore::{format_usage, help_about, help_usage, show_warning}; +use uucore::{format_usage, show_warning}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub mod verbosity { diff --git a/src/uu/tee/src/tee.rs b/src/uu/tee/src/tee.rs index e366e1474..e5269caf2 100644 --- a/src/uu/tee/src/tee.rs +++ b/src/uu/tee/src/tee.rs @@ -12,14 +12,14 @@ use std::path::PathBuf; use uucore::display::Quotable; use uucore::error::UResult; use uucore::parser::shortcut_value_parser::ShortcutValueParser; -use uucore::{format_usage, help_about, help_section, help_usage, show_error}; +use uucore::{format_usage, show_error}; // spell-checker:ignore nopipe #[cfg(unix)] use uucore::signals::{enable_pipe_errors, ignore_interrupts}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const APPEND: &str = "append"; diff --git a/src/uu/test/src/test.rs b/src/uu/test/src/test.rs index 16c179bcf..674e70dd3 100644 --- a/src/uu/test/src/test.rs +++ b/src/uu/test/src/test.rs @@ -17,11 +17,11 @@ use std::fs; use std::os::unix::fs::MetadataExt; use uucore::display::Quotable; use uucore::error::{UResult, USimpleError}; +use uucore::format_usage; #[cfg(not(windows))] use uucore::process::{getegid, geteuid}; -use uucore::{format_usage, help_about, help_section}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; // The help_usage method replaces util name (the first word) with {}. // And, The format_usage method replaces {} with execution_phrase ( e.g. test or [ ). diff --git a/src/uu/timeout/src/timeout.rs b/src/uu/timeout/src/timeout.rs index f7ab93725..35232d3e4 100644 --- a/src/uu/timeout/src/timeout.rs +++ b/src/uu/timeout/src/timeout.rs @@ -17,16 +17,15 @@ use uucore::error::{UClapError, UResult, USimpleError, UUsageError}; use uucore::parser::parse_time; use uucore::process::ChildExt; +use uucore::locale::get_message; #[cfg(unix)] use uucore::signals::enable_pipe_errors; use uucore::{ - format_usage, help_about, help_usage, show_error, + format_usage, show_error, signals::{signal_by_name_or_value, signal_name_by_value}, }; -use uucore::locale::{self, get_message}; - pub mod options { pub static FOREGROUND: &str = "foreground"; pub static KILL_AFTER: &str = "kill-after"; diff --git a/src/uu/touch/src/touch.rs b/src/uu/touch/src/touch.rs index 22f546496..c12c50530 100644 --- a/src/uu/touch/src/touch.rs +++ b/src/uu/touch/src/touch.rs @@ -23,9 +23,10 @@ use std::path::{Path, PathBuf}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; use uucore::parser::shortcut_value_parser::ShortcutValueParser; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; use crate::error::TouchError; +use uucore::locale::get_message; /// Options contains all the possible behaviors and flags for touch. /// @@ -83,8 +84,6 @@ pub enum Source { Now, } -use uucore::locale::{self, get_message}; - pub mod options { // Both SOURCES and sources are needed as we need to be able to refer to the ArgGroup. pub static SOURCES: &str = "sources"; diff --git a/src/uu/tr/src/tr.rs b/src/uu/tr/src/tr.rs index 3e3cc61cb..5259990bf 100644 --- a/src/uu/tr/src/tr.rs +++ b/src/uu/tr/src/tr.rs @@ -18,9 +18,9 @@ use std::io::{BufWriter, Write, stdin, stdout}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; use uucore::fs::is_stdin_directory; -use uucore::{format_usage, help_about, help_section, help_usage, os_str_as_bytes, show}; +use uucore::{format_usage, os_str_as_bytes, show}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const COMPLEMENT: &str = "complement"; diff --git a/src/uu/true/src/true.rs b/src/uu/true/src/true.rs index 89a302a45..4036024a4 100644 --- a/src/uu/true/src/true.rs +++ b/src/uu/true/src/true.rs @@ -5,9 +5,8 @@ use clap::{Arg, ArgAction, Command}; use std::{ffi::OsString, io::Write}; use uucore::error::{UResult, set_exit_code}; -use uucore::help_about; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { diff --git a/src/uu/truncate/src/truncate.rs b/src/uu/truncate/src/truncate.rs index ccf9c642e..461ed8057 100644 --- a/src/uu/truncate/src/truncate.rs +++ b/src/uu/truncate/src/truncate.rs @@ -12,8 +12,9 @@ use std::os::unix::fs::FileTypeExt; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; +use uucore::format_usage; +use uucore::locale::get_message; use uucore::parser::parse_size::{ParseSizeError, parse_size_u64}; -use uucore::{format_usage, help_about, help_section, help_usage}; #[derive(Debug, Eq, PartialEq)] enum TruncateMode { @@ -71,8 +72,6 @@ impl TruncateMode { } } -use uucore::locale::{self, get_message}; - pub mod options { pub static IO_BLOCKS: &str = "io-blocks"; pub static NO_CREATE: &str = "no-create"; diff --git a/src/uu/tsort/src/tsort.rs b/src/uu/tsort/src/tsort.rs index ce8ee050f..3a3a3c51c 100644 --- a/src/uu/tsort/src/tsort.rs +++ b/src/uu/tsort/src/tsort.rs @@ -9,9 +9,9 @@ use std::path::Path; use thiserror::Error; use uucore::display::Quotable; use uucore::error::{UError, UResult}; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const FILE: &str = "file"; diff --git a/src/uu/tty/src/tty.rs b/src/uu/tty/src/tty.rs index 1673ba389..7cad08ba8 100644 --- a/src/uu/tty/src/tty.rs +++ b/src/uu/tty/src/tty.rs @@ -10,9 +10,9 @@ use clap::{Arg, ArgAction, Command}; use std::io::{IsTerminal, Write}; use uucore::error::{UResult, set_exit_code}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; mod options { pub const SILENT: &str = "silent"; diff --git a/src/uu/uname/src/uname.rs b/src/uu/uname/src/uname.rs index 7c43049e7..cc3a4f471 100644 --- a/src/uu/uname/src/uname.rs +++ b/src/uu/uname/src/uname.rs @@ -7,13 +7,12 @@ use clap::{Arg, ArgAction, Command}; use platform_info::*; +use uucore::locale::get_message; use uucore::{ error::{UResult, USimpleError}, - format_usage, help_about, help_usage, + format_usage, }; -use uucore::locale::{self, get_message}; - pub mod options { pub static ALL: &str = "all"; pub static KERNEL_NAME: &str = "kernel-name"; diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index 12ea29d84..1b075dd2f 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -15,9 +15,9 @@ use thiserror::Error; use unicode_width::UnicodeWidthChar; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult, USimpleError}; -use uucore::{format_usage, help_about, help_usage, show}; +use uucore::{format_usage, show}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; const DEFAULT_TABSTOP: usize = 8; diff --git a/src/uu/uniq/src/uniq.rs b/src/uu/uniq/src/uniq.rs index 9147b3392..00ca6751b 100644 --- a/src/uu/uniq/src/uniq.rs +++ b/src/uu/uniq/src/uniq.rs @@ -13,11 +13,11 @@ use std::io::{BufRead, BufReader, BufWriter, Write, stdin, stdout}; use std::num::IntErrorKind; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult, USimpleError}; +use uucore::format_usage; use uucore::parser::shortcut_value_parser::ShortcutValueParser; use uucore::posix::{OBSOLETE, posix_version}; -use uucore::{format_usage, help_about, help_section, help_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub static ALL_REPEATED: &str = "all-repeated"; diff --git a/src/uu/unlink/src/unlink.rs b/src/uu/unlink/src/unlink.rs index 311a8482b..418e59b6e 100644 --- a/src/uu/unlink/src/unlink.rs +++ b/src/uu/unlink/src/unlink.rs @@ -12,9 +12,9 @@ use clap::{Arg, Command}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; static OPT_PATH: &str = "FILE"; #[uucore::main] diff --git a/src/uu/uptime/src/uptime.rs b/src/uu/uptime/src/uptime.rs index 25743af78..081f18cab 100644 --- a/src/uu/uptime/src/uptime.rs +++ b/src/uu/uptime/src/uptime.rs @@ -16,7 +16,7 @@ use uucore::uptime::*; use clap::{Arg, ArgAction, Command, ValueHint, builder::ValueParser}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; #[cfg(unix)] #[cfg(not(target_os = "openbsd"))] @@ -31,7 +31,7 @@ const ABOUT: &str = concat!( ); #[cfg(not(target_env = "musl"))] -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; pub mod options { pub static SINCE: &str = "since"; diff --git a/src/uu/users/src/users.rs b/src/uu/users/src/users.rs index ff0f4190e..0af2f390b 100644 --- a/src/uu/users/src/users.rs +++ b/src/uu/users/src/users.rs @@ -11,7 +11,7 @@ use std::path::Path; use clap::builder::ValueParser; use clap::{Arg, Command}; use uucore::error::UResult; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; #[cfg(target_os = "openbsd")] use utmp_classic::{UtmpEntry, parse_from_path}; @@ -26,7 +26,7 @@ const ABOUT: &str = concat!( ); #[cfg(not(target_env = "musl"))] -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; #[cfg(target_os = "openbsd")] const OPENBSD_UTMP_FILE: &str = "/var/run/utmp"; diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index f10c74d82..f3414bb43 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -24,10 +24,11 @@ use clap::{Arg, ArgAction, ArgMatches, Command, builder::ValueParser}; use thiserror::Error; use unicode_width::UnicodeWidthChar; use utf8::{BufReadDecoder, BufReadDecoderError}; +use uucore::locale::get_message; use uucore::{ error::{FromIo, UError, UResult}, - format_usage, help_about, help_usage, + format_usage, parser::shortcut_value_parser::ShortcutValueParser, quoting_style::{self, QuotingStyle}, show, @@ -113,8 +114,6 @@ impl<'a> Settings<'a> { } } -use uucore::locale::{self, get_message}; - mod options { pub static BYTES: &str = "bytes"; pub static CHAR: &str = "chars"; diff --git a/src/uu/who/src/who.rs b/src/uu/who/src/who.rs index 9fb6d1c19..00e90ebce 100644 --- a/src/uu/who/src/who.rs +++ b/src/uu/who/src/who.rs @@ -6,7 +6,7 @@ // spell-checker:ignore (ToDO) ttyname hostnames runlevel mesg wtmp statted boottime deadprocs initspawn clockchange curr runlvline pidstr exitstr hoststr use clap::{Arg, ArgAction, Command}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::format_usage; mod platform; @@ -37,7 +37,7 @@ const ABOUT: &str = concat!( ); #[cfg(not(target_env = "musl"))] -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; #[cfg(target_os = "linux")] static RUNLEVEL_HELP: &str = "print current runlevel"; diff --git a/src/uu/whoami/src/whoami.rs b/src/uu/whoami/src/whoami.rs index 4e1cc795c..701d3a107 100644 --- a/src/uu/whoami/src/whoami.rs +++ b/src/uu/whoami/src/whoami.rs @@ -9,12 +9,10 @@ use clap::Command; use uucore::display::println_verbatim; use uucore::error::{FromIo, UResult}; -use uucore::{format_usage, help_about, help_usage}; +use uucore::locale::get_message; mod platform; -use uucore::locale::{self, get_message}; - #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { uu_app().try_get_matches_from(args)?; diff --git a/src/uu/yes/src/yes.rs b/src/uu/yes/src/yes.rs index 33e922c76..add3f7027 100644 --- a/src/uu/yes/src/yes.rs +++ b/src/uu/yes/src/yes.rs @@ -10,11 +10,11 @@ use std::error::Error; use std::ffi::OsString; use std::io::{self, Write}; use uucore::error::{UResult, USimpleError}; +use uucore::format_usage; #[cfg(unix)] use uucore::signals::enable_pipe_errors; -use uucore::{format_usage, help_about, help_usage}; -use uucore::locale::{self, get_message}; +use uucore::locale::get_message; // it's possible that using a smaller or larger buffer might provide better performance on some // systems, but honestly this is good enough