19 lines
461 B
D
19 lines
461 B
D
import std.stdio;
|
|
import std.file;
|
|
import tiger;
|
|
|
|
void main (string[] parArgs) {
|
|
const auto cwd = getcwd();
|
|
const auto working_dir = cwd ~ (cwd[$-1] == '/' ? "" : "/");
|
|
|
|
foreach (arg; parArgs[1 .. $]) {
|
|
const auto curr_path = working_dir ~ arg;
|
|
File curr_file = File(curr_path, "rb");
|
|
if (!isDir(curr_path)) {
|
|
writefln("%s %s", tigerToString(getTiger(curr_file, true)), arg);
|
|
}
|
|
else {
|
|
writefln("tigersum: %s: is a directory", arg);
|
|
}
|
|
}
|
|
}
|