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
2 changes: 1 addition & 1 deletion src/uu/tac/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tac-help-separator = use STRING as the separator instead of newline

# Error messages
tac-error-invalid-regex = invalid regular expression: { $error }
tac-error-invalid-argument = { $argument }: read error: Invalid argument
tac-error-invalid-directory-argument = { $argument }: read error: Is a directory
tac-error-file-not-found = failed to open { $filename } for reading: No such file or directory
tac-error-read-error = failed to read from { $filename }: { $error }
tac-error-write-error = failed to write to stdout: { $error }
2 changes: 1 addition & 1 deletion src/uu/tac/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tac-help-separator = utiliser CHAÎNE comme séparateur au lieu du saut de ligne

# Messages d'erreur
tac-error-invalid-regex = expression régulière invalide : { $error }
tac-error-invalid-argument = { $argument } : erreur de lecture : Argument invalide
tac-error-file-not-found = échec de l'ouverture de { $filename } en lecture : Aucun fichier ou répertoire de ce type
tac-error-read-error = échec de la lecture depuis { $filename } : { $error }
tac-error-write-error = échec de l'écriture vers stdout : { $error }
tac-error-invalid-directory-argument = { $argument } : erreur de lecture : Est un répertoire
6 changes: 3 additions & 3 deletions src/uu/tac/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ pub enum TacError {
/// A regular expression given by the user is invalid.
#[error("{}", translate!("tac-error-invalid-regex", "error" => .0))]
InvalidRegex(regex::Error),
/// An argument to tac is invalid.
#[error("{}", translate!("tac-error-invalid-argument", "argument" => .0.maybe_quote()))]
InvalidArgument(OsString),
/// The argument to tac is a directory.
#[error("{}", translate!("tac-error-invalid-directory-argument", "argument" => .0.maybe_quote()))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think tac-error-invalid-argument should be removed, no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh from the locale?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, from the fluent files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the oversight

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, don't be sorry

InvalidDirectoryArgument(OsString),
/// The specified file is not found on the filesystem.
#[error("{}", translate!("tac-error-file-not-found", "filename" => .0.quote()))]
FileNotFound(OsString),
Expand Down
3 changes: 2 additions & 1 deletion src/uu/tac/src/tac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ fn tac(filenames: &[OsString], before: bool, regex: bool, separator: &str) -> UR
} else {
let path = Path::new(filename);
if path.is_dir() {
let e: Box<dyn UError> = TacError::InvalidArgument(filename.clone()).into();
let e: Box<dyn UError> =
TacError::InvalidDirectoryArgument(filename.clone()).into();
show!(e);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_tac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn test_invalid_input() {
.ucmd()
.arg("a")
.fails()
.stderr_contains("a: read error: Invalid argument");
.stderr_contains("a: read error: Is a directory");
}

#[test]
Expand Down
Loading