logo

deblob

remove binary executables from a directory git clone https://hacktivis.me/git/deblob.git
commit: 3493120fa88b3c74ef7208069864fea9d26d6feb
parent 08538feb54dedd434d95911f831dc783d0a9eb71
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 18 Feb 2022 00:01:47 +0100

snake_case function names

Diffstat:

Mmain.ha10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/main.ha b/main.ha @@ -16,7 +16,7 @@ type ok = !void; let excludes: []str = []; let noop: bool = false; -fn isBlob(filename: str) (bool|invalid) = { +fn is_blob(filename: str) (bool|invalid) = { static let buffer: [512]u8 = [0...]; static const elf: []u8 = [0x7F, 'E', 'L', 'F']; static const ar: []u8 = ['!', '<', 'a', 'r', 'c', 'h', '>', '\n']; // <arch>! @@ -53,7 +53,7 @@ fn is_excluded(filename: str) bool = { return false; }; -fn checkDir(dirname: str, ignoring: bool) (ok|invalid) = { +fn check_dir(dirname: str, ignoring: bool) (ok|invalid) = { let dir_ls = match(os::readdir(dirname)) { case let d: []fs::dirent => yield d; case let e: fs::error => @@ -74,11 +74,11 @@ fn checkDir(dirname: str, ignoring: bool) (ok|invalid) = { }; if(fs::isdir(file.ftype)) { - match(checkDir(filename, ignoring)) { + match(check_dir(filename, ignoring)) { case => continue; }; } else { - let is_blob = match(isBlob(filename)) { + let is_blob = match(is_blob(filename)) { case let b: bool => yield b; case invalid => continue; }; @@ -142,7 +142,7 @@ export fn main() void = { fmt::println(":: Checking for blobs")!; - let ret = checkDir(".", false); + let ret = check_dir(".", false); fmt::println(":: Done checking for blobs")!;