Skip to content
Snippets Groups Projects
Commit 720f06e3 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

* A flag `--flat' to just compute the MD5 checksum of the contents of

  a regular file.  I.e., `nix-hash --flat' is equivalent to the
  coreutils `md5sum' command (which doesn't exist on all systems).
parent 37483672
No related branches found
No related tags found
No related merge requests found
......@@ -6,9 +6,13 @@
void run(Strings args)
{
for (Strings::iterator it = args.begin();
it != args.end(); it++)
cout << format("%1%\n") % (string) hashPath(*it);
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));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment