2014-09-19 16:19:25 +00:00
|
|
|
import std.stdio;
|
2014-09-24 08:09:35 +00:00
|
|
|
import std.file;
|
2014-09-24 18:36:53 +00:00
|
|
|
import tiger;
|
2014-09-19 16:19:25 +00:00
|
|
|
|
|
|
|
void main (string[] parArgs) {
|
2014-09-24 08:09:35 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2014-09-19 16:19:25 +00:00
|
|
|
}
|