Skip to content

Commit 1904b62

Browse files
committed
feat(rm): add localized prompt messages for interactive mode
Add translations for rm command prompts in English and French, and update Linux-specific code to use localized strings instead of hardcoded messages, improving internationalization support.
1 parent fe7b1ce commit 1904b62

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/uu/rm/src/rm.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,27 @@ fn is_writable_metadata(metadata: &Metadata) -> bool {
551551
(mode & 0o200) > 0
552552
}
553553

554+
/// Whether the given file or directory is writable.
555+
#[cfg(unix)]
556+
fn is_writable(path: &Path) -> bool {
557+
match fs::metadata(path) {
558+
Err(_) => false,
559+
Ok(metadata) => is_writable_metadata(&metadata),
560+
}
561+
}
562+
554563
#[cfg(not(unix))]
555564
fn is_writable_metadata(_metadata: &Metadata) -> bool {
556565
true
557566
}
558567

568+
/// Whether the given file or directory is writable.
569+
#[cfg(not(unix))]
570+
fn is_writable(_path: &Path) -> bool {
571+
// TODO Not yet implemented.
572+
true
573+
}
574+
559575
/// Recursively remove the directory tree rooted at the given path.
560576
///
561577
/// If `path` is a file or a symbolic link, just remove it. If it is a

0 commit comments

Comments
 (0)