Skip to content

Commit

Permalink
tweak: don't add period to end of each log
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19 committed Nov 18, 2024
1 parent 2eca233 commit df6d2ce
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/archive/sevenz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
));

Expand All @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/archive/tar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
));

Expand All @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/archive/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
));
}
Expand All @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/decompress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
));
Expand Down Expand Up @@ -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));
Expand All @@ -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)
));

Expand Down Expand Up @@ -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),
));
Expand Down
2 changes: 1 addition & 1 deletion src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
//
Expand Down
2 changes: 1 addition & 1 deletion src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down

0 comments on commit df6d2ce

Please sign in to comment.