Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/uu/base32/src/base_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Config {
Some(mut values) => {
let name = values.next().unwrap();
if values.len() != 0 {
return Err(format!("extra operand ‘{}’", name));
return Err(format!("extra operand '{}'", name));
}

if name == "-" {
Expand All @@ -58,7 +58,7 @@ impl Config {
.value_of(options::WRAP)
.map(|num| {
num.parse::<usize>()
.map_err(|e| format!("Invalid wrap size: ‘{}’: {}", num, e))
.map_err(|e| format!("Invalid wrap size: '{}': {}", num, e))
})
.transpose()?;

Expand Down
4 changes: 2 additions & 2 deletions src/uu/chown/src/chown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ fn parse_spec(spec: &str) -> Result<(Option<u32>, Option<u32>), String> {
let uid = if usr_only || usr_grp {
Some(
Passwd::locate(args[0])
.map_err(|_| format!("invalid user: ‘{}’", spec))?
.map_err(|_| format!("invalid user: '{}'", spec))?
.uid(),
)
} else {
Expand All @@ -290,7 +290,7 @@ fn parse_spec(spec: &str) -> Result<(Option<u32>, Option<u32>), String> {
let gid = if grp_only || usr_grp {
Some(
Group::locate(args[1])
.map_err(|_| format!("invalid group: ‘{}’", spec))?
.map_err(|_| format!("invalid group: '{}'", spec))?
.gid(),
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ fn copy_link(source: &Path, dest: &Path) -> CopyResult<()> {
Some(name) => dest.join(name).into(),
None => crash!(
EXIT_ERR,
"cannot stat ‘{}’: No such file or directory",
"cannot stat '{}': No such file or directory",
source.display()
),
}
Expand Down
6 changes: 3 additions & 3 deletions src/uu/date/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {

let format = if let Some(form) = matches.value_of(OPT_FORMAT) {
if !form.starts_with('+') {
eprintln!("date: invalid date ‘{}’", form);
eprintln!("date: invalid date '{}'", form);
return 1;
}
let form = form[1..].to_string();
Expand Down Expand Up @@ -239,7 +239,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
let set_to = match matches.value_of(OPT_SET).map(parse_date) {
None => None,
Some(Err((input, _err))) => {
eprintln!("date: invalid date ‘{}’", input);
eprintln!("date: invalid date '{}'", input);
return 1;
}
Some(Ok(date)) => Some(date),
Expand Down Expand Up @@ -305,7 +305,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
println!("{}", formatted);
}
Err((input, _err)) => {
println!("date: invalid date ‘{}’", input);
println!("date: invalid date '{}'", input);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/uu/dircolors/src/dircolors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
if matches.is_present(options::PRINT_DATABASE) {
if !files.is_empty() {
show_usage_error!(
"extra operand ‘{}’\nfile operands cannot be combined with \
"extra operand '{}'\nfile operands cannot be combined with \
--print-database (-p)",
files[0]
);
Expand Down Expand Up @@ -155,7 +155,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
result = parse(INTERNAL_DB.lines(), out_format, "")
} else {
if files.len() > 1 {
show_usage_error!("extra operand ‘{}’", files[1]);
show_usage_error!("extra operand '{}'", files[1]);
return 1;
}
match File::open(files[0]) {
Expand Down
14 changes: 5 additions & 9 deletions src/uu/du/src/du.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ fn du(
Err(e) => {
safe_writeln!(
stderr(),
"{}: cannot read directory ‘{}‘: {}",
"{}: cannot read directory '{}': {}",
options.program_name,
my_stat.path.display(),
e
Expand Down Expand Up @@ -318,9 +318,7 @@ fn du(
let error_message = "Permission denied";
show_error_custom_description!(description, "{}", error_message)
}
_ => {
show_error!("cannot access '{}': {}", entry.path().display(), error)
}
_ => show_error!("cannot access '{}': {}", entry.path().display(), error),
},
},
Err(error) => show_error!("{}", error),
Expand Down Expand Up @@ -594,9 +592,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {

let files = match matches.value_of(options::FILE) {
Some(_) => matches.values_of(options::FILE).unwrap().collect(),
None => {
vec!["."]
}
None => vec!["."],
};

let block_size = u64::try_from(read_block_size(matches.value_of(options::BLOCK_SIZE))).unwrap();
Expand Down Expand Up @@ -693,8 +689,8 @@ Try '{} --help' for more information.",
time
} else {
show_error!(
"Invalid argument ‘{}‘ for --time.
birth and creation arguments are not supported on this platform.",
"Invalid argument '{}' for --time.
'birth' and 'creation' arguments are not supported on this platform.",
s
);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/uu/id/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
match Passwd::locate(users[i].as_str()) {
Ok(p) => Some(p),
Err(_) => {
show_error!("‘{}’: no such user", users[i]);
show_error!("'{}': no such user", users[i]);
exit_code = 1;
if i + 1 >= users.len() {
break;
Expand Down
4 changes: 2 additions & 2 deletions src/uu/ls/src/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl Config {
.value_of(options::WIDTH)
.map(|x| {
x.parse::<u16>().unwrap_or_else(|_e| {
show_error!("invalid line width: ‘{}’", x);
show_error!("invalid line width: '{}'", x);
exit(2);
})
})
Expand Down Expand Up @@ -756,7 +756,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
Arg::with_name(options::time::CHANGE)
.short(options::time::CHANGE)
.help("If the long listing format (e.g., -l, -o) is being used, print the status \
change time (the ctime in the inode) instead of the modification time. When \
change time (the 'ctime' in the inode) instead of the modification time. When \
explicitly sorting by time (--sort=time or -t) or when not using a long listing \
format, sort according to the status change time.")
.overrides_with_all(&[
Expand Down
2 changes: 1 addition & 1 deletion src/uu/mknod/src/mknod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn valid_type(tpe: String) -> Result<(), String> {
if vec!['b', 'c', 'u', 'p'].contains(&first_char) {
Ok(())
} else {
Err(format!("invalid device type ‘{}’", tpe))
Err(format!("invalid device type '{}'", tpe))
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/uu/mktemp/src/mktemp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {

if matches.is_present(OPT_TMPDIR) && PathBuf::from(prefix).is_absolute() {
show_error!(
"invalid template, ‘{}’; with --tmpdir, it may not be absolute",
"invalid template, '{}'; with --tmpdir, it may not be absolute",
template
);
return 1;
Expand Down
22 changes: 11 additions & 11 deletions src/uu/mv/src/mv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ fn exec(files: &[PathBuf], b: Behavior) -> i32 {
// lacks permission to access metadata.
if source.symlink_metadata().is_err() {
show_error!(
"cannot stat ‘{}’: No such file or directory",
"cannot stat '{}': No such file or directory",
source.display()
);
return 1;
Expand All @@ -240,7 +240,7 @@ fn exec(files: &[PathBuf], b: Behavior) -> i32 {
if b.no_target_dir {
if !source.is_dir() {
show_error!(
"cannot overwrite directory ‘{}’ with non-directory",
"cannot overwrite directory '{}' with non-directory",
target.display()
);
return 1;
Expand All @@ -249,7 +249,7 @@ fn exec(files: &[PathBuf], b: Behavior) -> i32 {
return match rename(source, target, &b) {
Err(e) => {
show_error!(
"cannot move ‘{}’ to ‘{}’: {}",
"cannot move '{}' to '{}': {}",
source.display(),
target.display(),
e.to_string()
Expand All @@ -263,7 +263,7 @@ fn exec(files: &[PathBuf], b: Behavior) -> i32 {
return move_files_into_dir(&[source.clone()], target, &b);
} else if target.exists() && source.is_dir() {
show_error!(
"cannot overwrite non-directory ‘{}’ with directory ‘{}’",
"cannot overwrite non-directory '{}' with directory '{}'",
target.display(),
source.display()
);
Expand All @@ -278,7 +278,7 @@ fn exec(files: &[PathBuf], b: Behavior) -> i32 {
_ => {
if b.no_target_dir {
show_error!(
"mv: extra operand ‘{}’\n\
"mv: extra operand '{}'\n\
Try '{} --help' for more information.",
files[2].display(),
executable!()
Expand All @@ -294,7 +294,7 @@ fn exec(files: &[PathBuf], b: Behavior) -> i32 {

fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, b: &Behavior) -> i32 {
if !target_dir.is_dir() {
show_error!("target ‘{}’ is not a directory", target_dir.display());
show_error!("target '{}' is not a directory", target_dir.display());
return 1;
}

Expand All @@ -304,7 +304,7 @@ fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, b: &Behavior) -> i3
Some(name) => target_dir.join(name),
None => {
show_error!(
"cannot stat ‘{}’: No such file or directory",
"cannot stat '{}': No such file or directory",
sourcepath.display()
);

Expand All @@ -315,7 +315,7 @@ fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, b: &Behavior) -> i3

if let Err(e) = rename(sourcepath, &targetpath, b) {
show_error!(
"cannot move ‘{}’ to ‘{}’: {}",
"cannot move '{}' to '{}': {}",
sourcepath.display(),
targetpath.display(),
e.to_string()
Expand All @@ -338,7 +338,7 @@ fn rename(from: &Path, to: &Path, b: &Behavior) -> io::Result<()> {
match b.overwrite {
OverwriteMode::NoClobber => return Ok(()),
OverwriteMode::Interactive => {
println!("{}: overwrite ‘{}’? ", executable!(), to.display());
println!("{}: overwrite '{}'? ", executable!(), to.display());
if !read_yes() {
return Ok(());
}
Expand Down Expand Up @@ -371,9 +371,9 @@ fn rename(from: &Path, to: &Path, b: &Behavior) -> io::Result<()> {
rename_with_fallback(from, to)?;

if b.verbose {
print!("‘{}’ -> ‘{}’", from.display(), to.display());
print!("'{}' -> '{}'", from.display(), to.display());
match backup_path {
Some(path) => println!(" (backup: ‘{}’)", path.display()),
Some(path) => println!(" (backup: '{}')", path.display()),
None => println!(),
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/uu/numfmt/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'a> Iterator for WhitespaceSplitter<'a> {

fn parse_suffix(s: &str) -> Result<(f64, Option<Suffix>)> {
if s.is_empty() {
return Err("invalid number: ‘’".to_string());
return Err("invalid number: ''".to_string());
}

let with_i = s.ends_with('i');
Expand All @@ -80,7 +80,7 @@ fn parse_suffix(s: &str) -> Result<(f64, Option<Suffix>)> {
Some('Z') => Ok(Some((RawSuffix::Z, with_i))),
Some('Y') => Ok(Some((RawSuffix::Y, with_i))),
Some('0'..='9') => Ok(None),
_ => Err(format!("invalid suffix in input: ‘{}’", s)),
_ => Err(format!("invalid suffix in input: '{}'", s)),
}?;

let suffix_len = match suffix {
Expand All @@ -91,7 +91,7 @@ fn parse_suffix(s: &str) -> Result<(f64, Option<Suffix>)> {

let number = s[..s.len() - suffix_len]
.parse::<f64>()
.map_err(|_| format!("invalid number: ‘{}’", s))?;
.map_err(|_| format!("invalid number: '{}'", s))?;

Ok((number, suffix))
}
Expand Down
2 changes: 1 addition & 1 deletion src/uu/numfmt/src/numfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn parse_options(args: &ArgMatches) -> Result<NumfmtOptions> {
0 => Err(value),
_ => Ok(n),
})
.map_err(|value| format!("invalid header value ‘{}’", value))
.map_err(|value| format!("invalid header value '{}'", value))
}
}?;

Expand Down
2 changes: 1 addition & 1 deletion src/uu/pinky/src/pinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ fn idle_string(when: i64) -> String {
}

fn time_string(ut: &Utmpx) -> String {
time::strftime("%Y-%m-%d %H:%M", &ut.login_time()).unwrap()
time::strftime("%b %e %H:%M", &ut.login_time()).unwrap() // LC_ALL=C
}

impl Pinky {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/split/src/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl LineSplitter {
fn new(settings: &Settings) -> LineSplitter {
LineSplitter {
lines_per_split: settings.strategy_param.parse().unwrap_or_else(|_| {
crash!(1, "invalid number of lines: ‘{}’", settings.strategy_param)
crash!(1, "invalid number of lines: '{}'", settings.strategy_param)
}),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/uu/stat/src/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::{cmp, fs, iter};
macro_rules! check_bound {
($str: ident, $bound:expr, $beg: expr, $end: expr) => {
if $end >= $bound {
return Err(format!("‘{}’: invalid directive", &$str[$beg..$end]));
return Err(format!("'{}': invalid directive", &$str[$beg..$end]));
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/uu/test/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Parser {
self.expr();
match self.next_token() {
Symbol::Literal(s) if s == ")" => (),
_ => panic!("expected ‘)’"),
_ => panic!("expected ')'"),
}
}
}
Expand Down Expand Up @@ -314,7 +314,7 @@ impl Parser {
self.expr();

match self.tokens.next() {
Some(token) => Err(format!("extra argument ‘{}’", token.to_string_lossy())),
Some(token) => Err(format!("extra argument '{}'", token.to_string_lossy())),
None => Ok(()),
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/uu/test/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn eval(stack: &mut Vec<Symbol>) -> Result<bool, String> {
return Ok(true);
}
_ => {
return Err(format!("missing argument after {:?}", op));
return Err(format!("missing argument after '{:?}'", op));
}
};

Expand Down Expand Up @@ -140,7 +140,7 @@ fn eval(stack: &mut Vec<Symbol>) -> Result<bool, String> {
}

fn integers(a: &OsStr, b: &OsStr, op: &OsStr) -> Result<bool, String> {
let format_err = |value| format!("invalid integer ‘{}’", value);
let format_err = |value| format!("invalid integer '{}'", value);

let a = a.to_string_lossy();
let a: i64 = a.parse().map_err(|_| format_err(a))?;
Expand All @@ -156,15 +156,15 @@ fn integers(a: &OsStr, b: &OsStr, op: &OsStr) -> Result<bool, String> {
"-ge" => a >= b,
"-lt" => a < b,
"-le" => a <= b,
_ => return Err(format!("unknown operator ‘{}’", operator)),
_ => return Err(format!("unknown operator '{}'", operator)),
})
}

fn isatty(fd: &OsStr) -> Result<bool, String> {
let fd = fd.to_string_lossy();

fd.parse()
.map_err(|_| format!("invalid integer ‘{}’", fd))
.map_err(|_| format!("invalid integer '{}'", fd))
.map(|i| {
#[cfg(not(target_os = "redox"))]
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/tr/src/tr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {

if !(delete_flag || squeeze_flag) && sets.len() < 2 {
show_error!(
"missing operand after ‘{}’\nTry `{} --help` for more information.",
"missing operand after '{}'\nTry `{} --help` for more information.",
sets[0],
executable!()
);
Expand Down
Loading