2003-07-06 15:11:02 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include "hash.hh"
|
|
|
|
#include "shared.hh"
|
|
|
|
|
|
|
|
|
|
|
|
void run(Strings args)
|
|
|
|
{
|
2003-08-06 09:06:32 +00:00
|
|
|
bool flat = false;
|
|
|
|
for (Strings::iterator i = args.begin();
|
|
|
|
i != args.end(); i++)
|
|
|
|
if (*i == "--flat") flat = true;
|
|
|
|
else
|
|
|
|
cout << format("%1%\n") % (string)
|
|
|
|
(flat ? hashFile(*i) : hashPath(*i));
|
2003-07-06 15:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string programId = "nix-hash";
|
|
|
|
|