logo

deblob

remove binary executables from a directory git clone https://hacktivis.me/git/deblob.git
commit: 901425b25a1f46b49e7f81cd0ad6c34525e5eb82
parent ba5344b0496d98bb4e5adcb892d842d173fb46a8
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 11 Apr 2024 06:48:19 +0200

Prefix all error messages with "deblob: "

Diffstat:

Mmain.ha18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/main.ha b/main.ha @@ -216,7 +216,7 @@ fn is_blob(filename: str) (bool | fs::error | io::error) = { for (let i = 0z; i < len(tests); i += 1) { const result = is_blob(tests[i].1)!; if (result != tests[i].0) { - fmt::fatalf("is_blob({}) was incorrect, got {}, expected {}", + fmt::fatalf("deblob: is_blob({}) was incorrect, got {}, expected {}", tests[i].1, result, tests[i].0); }; }; @@ -236,7 +236,7 @@ fn check_dir(dirname: str) (void | errors::invalid) = { case let iter: *fs::iterator => yield iter; case let err: fs::error => - fmt::errorfln("os::iter({}): {}", dirname, fs::strerror(err))!; + fmt::errorfln("deblob: Filesystem error os::iter({}): {}", dirname, fs::strerror(err))!; return errors::invalid; }; defer fs::finish(iter); @@ -261,11 +261,11 @@ fn check_dir(dirname: str) (void | errors::invalid) = { case let b: bool => yield b; case let err: fs::error => - fmt::errorfln("Error opening {}: {}", + fmt::errorfln("deblob: Error opening {}: {}", filename, fs::strerror(err))!; continue; case let err: io::error => - fmt::errorfln("Error reading {}: {}", + fmt::errorfln("deblob: Error reading {}: {}", filename, io::strerror(err))!; continue; }; @@ -290,7 +290,7 @@ fn check_dir(dirname: str) (void | errors::invalid) = { case void => continue; case let e: fs::error => - fmt::errorfln("os::remove({}): {}", + fmt::errorfln("deblob: os::remove({}): {}", filename, fs::strerror(e))!; }; } else { @@ -307,7 +307,7 @@ fn check_dir(dirname: str) (void | errors::invalid) = { case let d: []fs::dirent => yield d; case let e: fs::error => - fmt::fatalf("os::readdir({}): {}", dirname, fs::strerror(e)); + fmt::fatalf("deblob: os::readdir({}): {}", dirname, fs::strerror(e)); }; assert(len(files_before) == 57); @@ -318,7 +318,7 @@ fn check_dir(dirname: str) (void | errors::invalid) = { case let d: []fs::dirent => yield d; case let e: fs::error => - fmt::fatalf("os::readdir({}): {}", dirname, fs::strerror(e)); + fmt::fatalf("deblob: os::readdir({}): {}", dirname, fs::strerror(e)); }; assert(len(files_after) == 29); }; @@ -341,7 +341,7 @@ export fn main() void = { case 'd' => match (os::chdir(opt.1)) { case let e: fs::error => - fmt::fatalf("os::chdir({}): {}", + fmt::fatalf("deblob: os::chdir({}): {}", opt.1, fs::strerror(e)); case void => void; @@ -349,7 +349,7 @@ export fn main() void = { case 'n' => noop = true; case => - fmt::fatalf("Unhandled option -{}", opt.0); + fmt::fatalf("deblob: Unhandled option -{}", opt.0); }; };