tweak: don't add period to end of each log

This commit is contained in:
João Marcos P. Bezerra 2024-11-18 00:16:54 -03:00 committed by João Marcos
parent 2eca233132
commit df6d2cea98
7 changed files with 13 additions and 13 deletions

View File

@ -49,7 +49,7 @@ where
if let Ok(handle) = &output_handle {
if matches!(Handle::from_path(path), Ok(x) if &x == handle) {
warning(format!(
"Cannot compress `{}` into itself, skipping.",
"Cannot compress `{}` into itself, skipping",
output_path.display()
));
@ -62,7 +62,7 @@ where
// spoken text for users using screen readers, braille displays
// and so on
if !quiet {
info(format!("Compressing '{}'.", EscapedPathDisplay::new(path)));
info(format!("Compressing '{}'", EscapedPathDisplay::new(path)));
}
let metadata = match path.metadata() {

View File

@ -109,7 +109,7 @@ where
if let Ok(handle) = &output_handle {
if matches!(Handle::from_path(path), Ok(x) if &x == handle) {
warning(format!(
"Cannot compress `{}` into itself, skipping.",
"Cannot compress `{}` into itself, skipping",
output_path.display()
));
@ -122,7 +122,7 @@ where
// spoken text for users using screen readers, braille displays
// and so on
if !quiet {
info(format!("Compressing '{}'.", EscapedPathDisplay::new(path)));
info(format!("Compressing '{}'", EscapedPathDisplay::new(path)));
}
if path.is_dir() {

View File

@ -197,7 +197,7 @@ where
if let Ok(handle) = &output_handle {
if matches!(Handle::from_path(path), Ok(x) if &x == handle) {
warning(format!(
"Cannot compress `{}` into itself, skipping.",
"Cannot compress `{}` into itself, skipping",
output_path.display()
));
}
@ -208,7 +208,7 @@ where
// spoken text for users using screen readers, braille displays
// and so on
if !quiet {
info(format!("Compressing '{}'.", EscapedPathDisplay::new(path)));
info(format!("Compressing '{}'", EscapedPathDisplay::new(path)));
}
let metadata = match path.metadata() {

View File

@ -78,7 +78,7 @@ pub fn decompress_file(
// as screen readers may not read a commands exit code, making it hard to reason
// about whether the command succeeded without such a message
info_accessible(format!(
"Successfully decompressed archive in {} ({} files).",
"Successfully decompressed archive in {} ({} files)",
nice_directory_display(output_dir),
files_unpacked
));
@ -228,7 +228,7 @@ pub fn decompress_file(
// as screen readers may not read a commands exit code, making it hard to reason
// about whether the command succeeded without such a message
info_accessible(format!(
"Successfully decompressed archive in {}.",
"Successfully decompressed archive in {}",
nice_directory_display(output_dir)
));
info_accessible(format!("Files unpacked: {}", files_unpacked));
@ -253,7 +253,7 @@ fn smart_unpack(
let temp_dir_path = temp_dir.path();
info_accessible(format!(
"Created temporary directory {} to hold decompressed elements.",
"Created temporary directory {} to hold decompressed elements",
nice_directory_display(temp_dir_path)
));
@ -283,7 +283,7 @@ fn smart_unpack(
// Rename the temporary directory to the archive name, which is output_file_path
fs::rename(&previous_path, &new_path)?;
info_accessible(format!(
"Successfully moved \"{}\" to \"{}\".",
"Successfully moved \"{}\" to \"{}\"",
nice_directory_display(&previous_path),
nice_directory_display(&new_path),
));

View File

@ -111,7 +111,7 @@ pub fn run(
// having a final status message is important especially in an accessibility context
// as screen readers may not read a commands exit code, making it hard to reason
// about whether the command succeeded without such a message
info_accessible(format!("Successfully compressed '{}'.", path_to_str(&output_path)));
info_accessible(format!("Successfully compressed '{}'", path_to_str(&output_path)));
} else {
// If Ok(false) or Err() occurred, delete incomplete file at `output_path`
//

View File

@ -200,7 +200,7 @@ pub fn separate_known_extensions_from_name(path: &Path) -> (&Path, Vec<Extension
let file_stem = name.trim_matches('.');
if SUPPORTED_EXTENSIONS.contains(&file_stem) || SUPPORTED_ALIASES.contains(&file_stem) {
warning(format!(
"Received a file with name '{file_stem}', but {file_stem} was expected as the extension."
"Received a file with name '{file_stem}', but {file_stem} was expected as the extension"
));
}
}

View File

@ -49,7 +49,7 @@ pub fn create_dir_if_non_existent(path: &Path) -> crate::Result<()> {
fs::create_dir_all(path)?;
// creating a directory is an important change to the file system we
// should always inform the user about
info_accessible(format!("Directory {} created.", EscapedPathDisplay::new(path)));
info_accessible(format!("Directory {} created", EscapedPathDisplay::new(path)));
}
Ok(())
}