This commit is contained in:
matcool 2022-10-14 19:09:33 -03:00
parent 07e36ceaf1
commit 1df4c898ac
No known key found for this signature in database
GPG key ID: BF58756086D7AB1C

View file

@ -1,11 +1,11 @@
#include <iostream>
#include "hash.hpp"
int main(int ac, char* av[]) {
if (ac < 2) {
int main(int argc, char** argv) {
if (argc < 2 || !ghc::filesystem::exists(argv[1])) {
std::cout << "Usage: \"checksum <file>\"\n";
return 1;
}
std::cout << calculateHash(av[1]) << std::hex;
std::cout << calculateHash(argv[1]) << std::endl;
return 0;
}