1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

l10n: adjust the code to use the fluent files instead of the PROG.md docs

This commit is contained in:
Sylvestre Ledru 2025-05-31 17:57:43 +02:00
parent 28c16dd6d1
commit 94c1fad206
96 changed files with 200 additions and 249 deletions

View file

@ -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";

View file

@ -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.

View file

@ -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";

View file

@ -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<u32, String> {
if let Some(gid_str) = group.strip_prefix(':') {

View file

@ -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<String>, Vec<O
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> 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);

View file

@ -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<GidUidOwnerFilter> {
let filter = if let Some(spec) = matches.get_one::<String>(options::FROM) {

View file

@ -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";

View file

@ -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,

View file

@ -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";

View file

@ -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

View file

@ -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";

View file

@ -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,

View file

@ -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";

View file

@ -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

View file

@ -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";

View file

@ -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,

View file

@ -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";

View file

@ -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,

View file

@ -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";

View file

@ -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<string_parser::Error> for EnvError {
}
}
use uucore::locale::{self, get_message};
use uucore::locale::get_message;
mod options {
pub const IGNORE_ENVIRONMENT: &str = "ignore-environment";

View file

@ -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";

View file

@ -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)

View file

@ -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";

View file

@ -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<()> {

View file

@ -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;

View file

@ -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";

View file

@ -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 {

View file

@ -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,

View file

@ -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 {

View file

@ -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<()> {

View file

@ -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";

View file

@ -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")]

View file

@ -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";

View file

@ -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 {

View file

@ -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

View file

@ -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";

View file

@ -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";

View file

@ -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<String> {
}
}
use uucore::locale::{self, get_message};
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let _ = uu_app().try_get_matches_from(args)?;

View file

@ -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();

View file

@ -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";

View file

@ -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";

View file

@ -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;

View file

@ -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";

View file

@ -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,

View file

@ -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";

View file

@ -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;

View file

@ -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.

View file

@ -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;

View file

@ -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)?;

View file

@ -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<Item = &'a str>, options: &NumfmtOptions) -> UResult<()> {
for l in args {
format_and_handle_validation(l, options)?;

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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;

View file

@ -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";

View file

@ -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";

View file

@ -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 {

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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(

View file

@ -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";

View file

@ -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";

View file

@ -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<usize>),
}
static USAGE: &str = help_usage!("shuf.md");
use uucore::locale::{self, get_message};
struct Options {
head_count: usize,
output: Option<PathBuf>,

View file

@ -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";

View file

@ -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 {

View file

@ -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);

View file

@ -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();

View file

@ -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";

View file

@ -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",

View file

@ -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];

View file

@ -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";

View file

@ -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";

View file

@ -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 {

View file

@ -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";

View file

@ -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 [ ).

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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<()> {

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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;

View file

@ -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";

View file

@ -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]

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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)?;

View file

@ -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