summaryrefslogtreecommitdiff
path: root/support/pkgcheck/src/messages/mod.rs
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-05-27 03:01:31 +0000
committerNorbert Preining <norbert@preining.info>2022-05-27 03:01:31 +0000
commit84a5593d3fb9d03aac5677678bcc4c92e8c9a9c4 (patch)
tree0212ba38147bcfe80e5c1a853071a6e6a45b87d7 /support/pkgcheck/src/messages/mod.rs
parent02d941fa9c9895bb08a84ac9afe3559abd1ba8ad (diff)
CTAN sync 202205270301
Diffstat (limited to 'support/pkgcheck/src/messages/mod.rs')
-rw-r--r--support/pkgcheck/src/messages/mod.rs602
1 files changed, 281 insertions, 321 deletions
diff --git a/support/pkgcheck/src/messages/mod.rs b/support/pkgcheck/src/messages/mod.rs
index f6819f1120..3de39bdb81 100644
--- a/support/pkgcheck/src/messages/mod.rs
+++ b/support/pkgcheck/src/messages/mod.rs
@@ -2,116 +2,87 @@ mod errorsd;
mod fatald;
mod informationd;
mod warningsd;
-
+use colored::Colorize;
use self::errorsd::*;
use self::fatald::*;
use self::informationd::*;
use self::warningsd::*;
-macro_rules! no_colors {
+macro_rules! error_occurred {
() => {
- $crate::ARGS.no_colors
+ $crate::ERROR_OCCURRED.store(true, Ordering::Relaxed);
};
}
-macro_rules! error_occured {
+
+macro_rules! no_colors {
() => {
- $crate::ERROR_OCCURED.store(true, Ordering::Relaxed);
+ $crate::ARGS.no_colors
};
}
-// macro_rules! yellow {
-// ($fmt:expr) => {
-// if no_colors!() {
-// $fmt.clear()
-// } else {
-// $fmt.bright_yellow()
-// }
-// };
-// }
-
-// macro_rules! red {
-// ($fmt:expr) => {
-// if no_colors!() {
-// $fmt.clear()
-// } else {
-// $fmt.bright_red()
-// }
-// };
-// }
-macro_rules! msgid {
+macro_rules! fatal {
($fmt:expr) => {
match (no_colors!(), &$fmt[..1]) {
(true, _) => $fmt.clear(),
- (false, "E") => $fmt.bright_red().bold(),
- (false, "I") => $fmt.bright_yellow().bold(),
- (false, "W") => $fmt.bright_red(),
- (false, "F") => $fmt.bright_red().bold(),
- (_, _) => $fmt.clear(),
+ (_, _) => $fmt.bright_red().bold(),
}
};
}
macro_rules! f0001 {
() => {{
- error_occured!();
- print!(
- "{} Specify a directory to check (use option -d)\n",
- msgid!("F0001")
- );
+ error_occurred!();
+ eprintln!("{} Specify a directory to check (use option -d)", fatal!("F0001"),);
}};
}
macro_rules! f0002 {
($fmt1:expr) => {{
- error_occured!();
- print!(
- "{} Specified directory {} does not exist. Exiting...\n",
- msgid!("F0002"),
- $fmt1
+ error_occurred!();
+ eprintln!(
+ "{} Specified directory {} does not exist. Exiting...",
+ fatal!("F0002"), $fmt1
);
}};
}
macro_rules! f0003 {
($fmt1:expr) => {{
- error_occured!();
- print!(
- "{} Specified TDS archive {} does not exist or is no file. Exiting...\n",
- msgid!("F0003"),
- $fmt1
+ error_occurred!();
+ eprintln!(
+ "{} Specified TDS archive {} does not exist or is no file. Exiting...",
+ fatal!("F0003"), $fmt1
);
}};
}
macro_rules! f0004 {
($fmt1:expr) => {{
- error_occured!();
- print!(
- "{} File {} specified as TDS archive is no zip archive. Exiting...\n",
- msgid!("F0004"),
- $fmt1
+ error_occurred!();
+ eprintln!(
+ "{} File {} specified as TDS archive is no zip archive. Exiting...",
+ fatal!("F0004"), $fmt1
);
}};
}
macro_rules! f0005 {
($fmt1:expr) => {{
- error_occured!();
- print!(
- "{} Bad filename {} for the tds.zip archive. Exiting...\n",
- msgid!("F0005"),
- $fmt1
+ error_occurred!();
+ eprintln!(
+ "{} Bad filename {} for the tds.zip archive. Exiting...",
+ fatal!("F0005"), $fmt1
);
}};
}
// macro_rules! f0006 {
// ($fmt1:expr) => {
-// error_occured!();
-// print!(
-// "{} Unknown error code `{}` specified with option -e resp. ---explain. Exiting...\n",
-// msgid!("F0006"),
+// error_occurred!();
+// error!(
+// "{} Unknown error code `{}` specified with option -e resp. ---explain. Exiting...",
+// "F0006",
// $fmt1
// );
// };
@@ -119,584 +90,558 @@ macro_rules! f0005 {
macro_rules! f0007 {
($fmt1:expr) => {{
- error_occured!();
- print!(
- "{} Unable to create temporary directory for unzipping the TDS zip archive: {}. Exiting...\n",
- msgid!("F0007"),
+ error_occurred!();
+ eprintln!(
+ "{} Unable to create temporary directory for unzipping the TDS zip archive: {}. Exiting...",
+ fatal!("F0007"),
$fmt1
);
}};
}
+macro_rules! f0008 {
+ ($fmt:expr) => {{
+ error_occurred!();
+ eprintln!(
+ "{} Config file {} doesn't exist. Exiting...",
+ fatal!("F0007"), $fmt
+ );
+ }};
+}
+
+macro_rules! f0009 {
+ ($fmt1:expr, $fmt2:expr) => {{
+ error_occurred!();
+ eprintln!(
+ "{} Error reading config file {}: {} Exiting...",
+ fatal!("F0009"), $fmt1, $fmt2
+ );
+ }};
+}
+
+macro_rules! f0010 {
+ ($fmt:expr) => {{
+ error_occurred!();
+ eprintln!(
+ "{} Config file's content could no be read properly: {} Exiting...",
+ fatal!("F0010"), $fmt
+ );
+ }};
+}
+
macro_rules! e0001 {
($fmt1:expr, $fmt2:expr, $fmt3:expr) => {{
- error_occured!();
- print!(
- "{} Bad character {} ({:#02x}) found in file name {} at offset {}\n",
- msgid!("E0001"),
- $fmt1,
- $fmt1 as usize,
- $fmt2,
- $fmt3
+ error_occurred!();
+ error!(
+ "{} Bad character {} ({:#02x}) found in file name {} at offset {}",
+ "E0001", $fmt1, $fmt1 as usize, $fmt2, $fmt3
);
}};
}
macro_rules! e0002 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} File {} has bad permissions: {}\n",
- msgid!("E0002"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ error!(
+ "{} File {} has bad permissions: {}",
+ "E0002", $fmt1, $fmt2
);
}};
}
macro_rules! e0003 {
($fmt:expr) => {{
- error_occured!();
- print!("{} {} is no text file\n", msgid!("E0003"), $fmt);
+ error_occurred!();
+ error!("{} {} is no text file", "E0003", $fmt);
}};
}
macro_rules! e0004 {
($fmt:expr) => {{
- error_occured!();
- print!("{} Empty directory {} detected\n", msgid!("E0004"), $fmt);
+ error_occurred!();
+ error!("{} Empty directory {} detected", "E0004", $fmt);
}};
}
macro_rules! e0005 {
($fmt:expr) => {{
- error_occured!();
- print!("{} Empty file {} detected\n", msgid!("E0005"), $fmt);
+ error_occurred!();
+ error!("{} Empty file {} detected", "E0005", $fmt);
}};
}
macro_rules! e0006 {
($fmt:expr) => {{
- error_occured!();
- print!("{} Hidden directory {} detected\n", msgid!("E0006"), $fmt);
+ error_occurred!();
+ error!("{} Hidden directory {} detected", "E0006", $fmt);
}};
}
macro_rules! e0006t {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Hidden directory {} detected in TDS zip archive\n",
- msgid!("E0006"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} Hidden directory {} detected in TDS zip archive",
+ "E0006", $fmt
);
}};
}
macro_rules! e0007 {
($fmt:expr) => {{
- error_occured!();
- print!("{} Hidden file {} detected\n", msgid!("E0007"), $fmt);
+ error_occurred!();
+ error!("{} Hidden file {} detected", "E0007", $fmt);
}};
}
macro_rules! e0007t {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Hidden file {} detected in TDS zip archive\n",
- msgid!("E0007"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} Hidden file {} detected in TDS zip archive",
+ "E0007", $fmt
);
}};
}
macro_rules! e0008 {
($fmt:expr) => {{
- error_occured!();
- print!("{} Temporary file {} detected\n", msgid!("E0008"), $fmt);
+ error_occurred!();
+ error!("{} Temporary file {} detected", "E0008", $fmt);
}};
}
macro_rules! e0008t {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Temporary file {} detected in TDS zip archive\n",
- msgid!("E0008"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} Temporary file {} detected in TDS zip archive",
+ "E0008", $fmt
);
}};
}
macro_rules! e0009 {
() => {{
- error_occured!();
- print!(
- "{} One of README/README.md/README.txt must exist\n",
- msgid!("E0009")
+ error_occurred!();
+ error!(
+ "{} One of README/README.md/README.txt must exist",
+ "E0009",
);
}};
}
macro_rules! e0010 {
($fmt:expr) => {{
- error_occured!();
- print!("{} {} is a broken symlink\n", msgid!("E0010"), $fmt);
+ error_occurred!();
+ error!("{} {} is a broken symlink", "E0010", $fmt);
}};
}
macro_rules! e0011 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} Directory {} has bad permissions: {}\n",
- msgid!("E0011"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ error!(
+ "{} Directory {} has bad permissions: {}",
+ "E0011", $fmt1, $fmt2
);
}};
}
macro_rules! e0012 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} File {} has CRLF line endings\n",
- msgid!("E0012"),
- $fmt
- );
+ error_occurred!();
+ error!("{} File {} has CRLF line endings", "E0012", $fmt);
}};
}
macro_rules! e0013 {
($fmt:expr) => {{
- error_occured!();
- print!("{} {} is a socket special file\n", msgid!("E0013"), $fmt);
+ error_occurred!();
+ error!("{} {} is a socket special file", "E0013", $fmt);
}};
}
macro_rules! e0014 {
($fmt:expr) => {{
- error_occured!();
- print!("{} {} is a fifo file\n", msgid!("E0014"), $fmt);
+ error_occurred!();
+ error!("{} {} is a fifo file", "E0014", $fmt);
}};
}
macro_rules! e0015 {
($fmt:expr) => {{
- error_occured!();
- print!("{} {} is a block device file\n", msgid!("E0015"), $fmt);
+ error_occurred!();
+ error!("{} {} is a block device file", "E0015", $fmt);
}};
}
macro_rules! e0016 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} {} is a character device file\n",
- msgid!("E0016"),
- $fmt
- );
+ error_occurred!();
+ error!("{} {} is a character device file", "E0016", $fmt);
}};
}
macro_rules! e0017 {
($fmt:expr) => {{
- error_occured!();
- print!("{} PDF error detected in {}\n", msgid!("E0017"), $fmt);
+ error_occurred!();
+ error!("{} PDF error detected in {}", "E0017", $fmt);
}};
}
macro_rules! e0018 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Unwanted directory {} detected\n",
- msgid!("E0018"),
- $fmt
- );
+ error_occurred!();
+ error!("{} Unwanted directory {} detected", "E0018", $fmt);
}};
}
macro_rules! e0019 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} {} generated by {} exists\n",
- msgid!("E0019"),
- $fmt1,
- $fmt2
- );
+ error_occurred!();
+ error!("{} {} generated by {} exists", "E0019", $fmt1, $fmt2);
}};
}
macro_rules! e0020 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Unwanted directory `{}` detected in the top level directory of a TDS archive\n",
- msgid!("E0020"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} Unwanted directory `{}` detected in the top level directory of a TDS archive",
+ "E0020", $fmt
);
}};
}
macro_rules! e0021 {
($fmt1:expr, $fmt2:expr, $fmt3:expr) => {{
- error_occured!();
- print!(
- "{} File {} : Error reading in line {}: {}\n",
- msgid!("E0021"),
- $fmt1,
- $fmt2,
- $fmt3
+ error_occurred!();
+ error!(
+ "{} File {} : Error reading in line {}: {}",
+ "E0021", $fmt1, $fmt2, $fmt3
);
}};
}
macro_rules! e0022 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!("{} {}: `{}`\n", msgid!("E0022"), $fmt1, $fmt2);
+ error_occurred!();
+ error!("{} {}: `{}`", "E0022", $fmt1, $fmt2);
}};
}
macro_rules! e0023 {
($fmt:expr) => {{
- error_occured!();
- print!("{} {}\n", msgid!("E0023"), $fmt);
+ error_occurred!();
+ error!("{} {}", "E0023", $fmt);
}};
}
macro_rules! e0024 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} The TDS zip archive {} has bad permissions: {}\n",
- msgid!("E0024"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ error!(
+ "{} The TDS zip archive {} has bad permissions: {}",
+ "E0024", $fmt1, $fmt2
);
}};
}
macro_rules! e0025 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Duplicate names when ignoring letter case for: {}\n",
- msgid!("E0025"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} Duplicate names when ignoring letter case for: {}",
+ "E0025", $fmt
);
}};
}
macro_rules! e0026 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} {} : file not in TDS or different in TDS and non-install tree\n",
- msgid!("E0026"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} {} : file not in TDS or different in TDS and non-install tree",
+ "E0026", $fmt
);
}};
}
macro_rules! e0027 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} {}: An I/O error occured -> {}\n",
- msgid!("E0027"),
- $fmt1,
- $fmt2
- );
+ error_occurred!();
+ error!("{} {}: An I/O error occurred -> {}", "E0027", $fmt1, $fmt2);
}};
}
macro_rules! e0028 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} No directory {} (= package name) found in path {}\n",
- msgid!("E0028"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ error!(
+ "{} No directory {} (= package name) found in path {}",
+ "E0028", $fmt1, $fmt2
);
}};
}
macro_rules! e0029 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} {}: {} encoding with BOM detected\n",
- msgid!("E0029"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ error!(
+ "{} {}: {} encoding with BOM detected",
+ "E0029", $fmt1, $fmt2
);
}};
}
macro_rules! e0030 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} Symlink {} points to {} which is outside of the package directory tree\n",
- msgid!("E0030"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ error!(
+ "{} Symlink {} points to {} which is outside of the package directory tree",
+ "E0030", $fmt1, $fmt2
);
}};
}
macro_rules! e0031 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} File name {} contains invalid UTF-8 character(s)\n",
- msgid!("E0031"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} File name {} contains invalid UTF-8 character(s)",
+ "E0031", $fmt
);
}};
}
macro_rules! e0033 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} Error `{}` when unpacking tds archive {}. Exiting...\n",
- msgid!("E0033"),
- $fmt2,
- $fmt1
+ error_occurred!();
+ error!(
+ "{} Error `{}` when unpacking tds archive {}. Exiting...",
+ "E0033", $fmt2, $fmt1
);
}};
}
macro_rules! e0034 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Unwanted file `{}` detected in the top level directory of a TDS archive\n",
- msgid!("E0034"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} Unwanted file `{}` detected in the top level directory of a TDS archive",
+ "E0034", $fmt
);
}};
}
macro_rules! e0035 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Unwanted TDS archive `{}` detected in package directory tree\n",
- msgid!("E0035"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} Unwanted TDS archive `{}` detected in package directory tree",
+ "E0035", $fmt
);
}};
}
macro_rules! e0036 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} File `{}` not below `source/` or `doc/` top level directory in TDS zip archive\n",
- msgid!("E0036"),
- $fmt
+ error_occurred!();
+ error!(
+ "{} File `{}` not below `source/` or `doc/` top level directory in TDS zip archive",
+ "E0036", $fmt
);
}};
}
macro_rules! e0037 {
($fmt:expr) => {{
- error_occured!();
- print!("{} File {} has CR line endings\n", msgid!("E0037"), $fmt);
+ error_occurred!();
+ error!("{} File {} has CR line endings", "E0037", $fmt);
}};
}
macro_rules! e0038 {
($fmt1:expr, $fmt2:expr, $fmt3:expr, $fmt4:expr) => {{
- error_occured!();
- print!(
- "{} File {} has inconsistent line endings: CR={}, LF={}, CRLF={}\n",
- msgid!("E0038"),
- $fmt1,
- $fmt2,
- $fmt3,
- $fmt4
+ error_occurred!();
+ error!(
+ "{} File {} has inconsistent line endings: CR={}, LF={}, CRLF={}",
+ "E0038", $fmt1, $fmt2, $fmt3, $fmt4
);
}};
}
macro_rules! e0039 {
() => {{
- error_occured!();
- print!("{} No doc/ directory found\n", msgid!("E0039"));
+ error_occurred!();
+ error!("{} No doc/ directory found", "E0039");
}};
}
macro_rules! e0040 {
() => {{
- error_occured!();
- print!(
- "{} Too few top level directories in the TDS zip archive\n",
- msgid!("E0040")
+ error_occurred!();
+ error!(
+ "{} Too few top level directories in the TDS zip archive",
+ "E0040",
);
}};
}
macro_rules! e0041 {
() => {{
- error_occured!();
- print!("{} One or more map file found for the package but none of them is in a path starting with fonts/map/dvips\n", msgid!("E0041"));
+ error_occurred!();
+ error!("{} One or more map file found for the package but none of them is in a path starting with fonts/map/dvips", "E0041");
}};
}
+
macro_rules! w0001 {
($fmt:expr) => {{
- print!(
- "{} Archive as package file detected: {}\n",
- msgid!("W0001"),
- $fmt
- );
+ warn!("{} Archive as package file detected: {}", "W0001", $fmt);
}};
}
macro_rules! w0002 {
() => {{
- print!("{} Duplicate files detected\n", msgid!("W0002"),);
+ warn!("{} Duplicate files detected", "W0002",);
}};
}
macro_rules! w0003 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Same named files detected in the package directory tree: {}\n",
- msgid!("W0003"),
- $fmt
+ error_occurred!();
+ warn!(
+ "{} Same named files detected in the package directory tree: {}",
+ "W0003", $fmt
);
}};
}
macro_rules! w0004 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} {}: {} encoding with BOM detected\n",
- msgid!("W0004"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ warn!(
+ "{} {}: {} encoding with BOM detected",
+ "W0004", $fmt1, $fmt2
);
}};
}
macro_rules! w0005 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} Very large file {} with size {}MiB detected\n",
- msgid!("W0005"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ warn!(
+ "{} Very large file {} with size {}MiB detected",
+ "W0005", $fmt1, $fmt2
)
}};
}
macro_rules! w0006 {
($fmt1:expr, $fmt2:expr) => {{
- error_occured!();
- print!(
- "{} Very large file {} with size {}MiB detected in TDS zip archive\n",
- msgid!("W0006"),
- $fmt1,
- $fmt2
+ error_occurred!();
+ warn!(
+ "{} Very large file {} with size {}MiB detected in TDS zip archive",
+ "W0006", $fmt1, $fmt2
)
}};
}
macro_rules! w0007 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Empty directory {} detected in TDS zip archive\n",
- msgid!("W0007"),
- $fmt
+ error_occurred!();
+ warn!(
+ "{} Empty directory {} detected in TDS zip archive",
+ "W0007", $fmt
);
}};
}
macro_rules! w0008 {
($fmt:expr) => {{
- error_occured!();
- print!(
- "{} Windows file {} has Unix line endings\n",
- msgid!("W0008"),
- $fmt
- );
+ error_occurred!();
+ warn!("{} Windows file {} has Unix line endings", "W0008", $fmt);
}};
}
+macro_rules! w0009 {
+ ($fmt1:expr, $fmt2:expr) => {{
+ error_occurred!();
+ warn!(
+ "{} Replacing `{} -> {}` with the same from config file",
+ "W0009",
+ $fmt1,
+ $fmt2
+ )
+ }};
+}
+
+
macro_rules! i0002 {
($fmt:expr) => {{
- print!(
- "{} {} {}\n",
- msgid!("I0002"),
- "Checking package files in directory",
- $fmt
+ info!(
+ "{} {} {}",
+ "I0002", "Checking package files in directory", $fmt
);
}};
}
macro_rules! i0003 {
($fmt:expr) => {{
- print!(
- "{} {} {}\n",
- msgid!("I0003"),
- "Checking TDS zip archive",
- $fmt
- );
+ info!("{} {} {}", "I0003", "Checking TDS zip archive", $fmt);
}};
}
macro_rules! i0004 {
($fmt:expr) => {{
- print!(
- "{} Correcting line endings for file {}\n",
- msgid!("I0004"),
- $fmt
- );
+ info!("{} Correcting line endings for file {}", "I0004", $fmt);
}};
}
macro_rules! i0005 {
($fmt:expr) => {{
- print!(
- "{} Correcting permissions for {}\n",
- msgid!("I0005"),
- $fmt
- );
+ info!("{} Correcting permissions for {}", "I0005", $fmt);
}};
}
macro_rules! i0006 {
() => {{
- print!(
- "{} Files having one of the following file name endings are regarded as temporary\n",
- msgid!("I0006")
+ info!(
+ "{} Files having one of the following file name endings are regarded as temporary",
+ "I0006",
);
}};
}
macro_rules! i0007 {
($fmt1:expr, $fmt2:expr) => {{
- print!(
- "{} {}: Successfully corrected wrong line endings to {}\n",
- msgid!("I0007"),
- $fmt1,
- $fmt2
+ info!(
+ "{} {}: Successfully corrected wrong line endings to {}",
+ "I0007", $fmt1, $fmt2
);
}};
}
+macro_rules! i0008 {
+ ($fmt1:expr) => {{
+ info!("{} Using config file {}", "I0008", $fmt1);
+ }};
+}
+
+macro_rules! i0009 {
+ ($fmt1:expr, $fmt2:expr, $fmt3:expr) => {{
+ error_occurred!();
+ warn!(
+ "{} Updating entry `{} -> {}` with `{} -> {}` from config file",
+ "I0009",
+ $fmt1,
+ $fmt2,
+ $fmt1,
+ $fmt3
+ )
+ }};
+}
+
pub fn explains(err: &str) {
let err_upp = err.to_ascii_uppercase();
match err_upp.as_str() {
@@ -707,6 +652,9 @@ pub fn explains(err: &str) {
"F0005" => f0005d(),
"F0006" => f0006d(),
"F0007" => f0007d(),
+ "F0008" => f0008d(),
+ "F0009" => f0009d(),
+ "F0010" => f0010d(),
"E0001" => e0001d(),
"E0002" => e0002d(),
@@ -757,6 +705,8 @@ pub fn explains(err: &str) {
"I0005" => i0005d(),
"I0006" => i0006d(),
"I0007" => i0007d(),
+ "I0008" => i0008d(),
+ "I0009" => i0009d(),
"W0001" => w0001d(),
"W0002" => w0002d(),
@@ -766,9 +716,11 @@ pub fn explains(err: &str) {
"W0006" => w0006d(),
"W0007" => w0007d(),
"W0008" => w0008d(),
+ "W0009" => w0009d(),
- e => println!(
- "F0006 Unknown error code `{}` specified with option -e resp. --explain. Exiting...",
+ e => eprintln!(
+ "{} Unknown error code `{}` specified with option -e resp. --explain. Exiting...",
+ fatal!("F0006"),
e
),
}
@@ -781,6 +733,11 @@ pub fn explains_all() {
explains("F0004");
explains("F0005");
explains("F0006");
+ explains("F0006");
+ explains("F0007");
+ explains("F0008");
+ explains("F0009");
+ explains("F0010");
explains("E0001");
explains("E0002");
@@ -830,6 +787,8 @@ pub fn explains_all() {
explains("I0005");
explains("I0006");
explains("I0007");
+ explains("I0008");
+ explains("I0009");
explains("W0001");
explains("W0002");
@@ -839,4 +798,5 @@ pub fn explains_all() {
explains("W0006");
explains("W0007");
explains("W0008");
+ explains("W0009");
}