+ if (root_hash!=Sha1Hash::ZERO && !filename)
+ filename = strdup(root_hash.hex().c_str());
+
+ int file = -1;
+ if (filename) {
+ file = Open(filename,root_hash);
+ if (file<=0)
+ quit("cannot open file %s",filename);
+ printf("Root hash: %s\n", RootMerkleHash(file).hex().c_str());
+ }
+
+ if (bindaddr==Address() && file==-1) {
+ fprintf(stderr,"Usage:\n");
+ fprintf(stderr," -h, --hash\troot Merkle hash for the transmission\n");
+ fprintf(stderr," -f, --file\tname of file to use (root hash by default)\n");
+ fprintf(stderr," -l, --listen\t[ip:|host:]port to listen to (default: random)\n");
+ fprintf(stderr," -t, --tracker\t[ip:|host:]port of the tracker (default: none)\n");
+ fprintf(stderr," -D, --debug\tfile name for debugging logs (default: stdout)\n");
+ fprintf(stderr," -p, --progress\treport transfer progress\n");
+ fprintf(stderr," -g, --http\t[ip:|host:]port to bind HTTP gateway to (default localhost:8080)\n");
+ fprintf(stderr," -w, --wait\tlimit running time, e.g. 1[DHMs] (default: infinite with -l, -g)\n");
+ }