From 53e376d836133a660223198c7bb8308fb912375e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 20 Oct 2003 09:20:11 +0000 Subject: * Refactored the source tree. --- src/nix-hash/nix-hash.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/nix-hash/nix-hash.cc (limited to 'src/nix-hash') diff --git a/src/nix-hash/nix-hash.cc b/src/nix-hash/nix-hash.cc new file mode 100644 index 000000000000..77c169b9a952 --- /dev/null +++ b/src/nix-hash/nix-hash.cc @@ -0,0 +1,20 @@ +#include + +#include "hash.hh" +#include "shared.hh" + + +void run(Strings args) +{ + 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)); +} + + +string programId = "nix-hash"; + -- cgit 1.4.1