mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Automatically integrates git build information into executables.
Usage:
func.exe -V
adnl-pong -V
validator-engine -V
and so on.
Result will be shown in the following format:
Func build information: [ Commit: d8b751d7a5
, Date: 2021-02-27 14:34:41 +0200]
This commit is contained in:
parent
41a3418b7b
commit
bab4c1637e
40 changed files with 492 additions and 78 deletions
|
@ -37,7 +37,7 @@
|
|||
#include <thread>
|
||||
#include <cstdlib>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "git.h"
|
||||
#include "Miner.h"
|
||||
|
||||
const char* progname;
|
||||
|
@ -46,7 +46,7 @@ int usage() {
|
|||
std::cerr
|
||||
<< "usage: " << progname
|
||||
<< " [-v][-B][-w<threads>] [-t<timeout>] <my-address> <pow-seed> <pow-complexity> <iterations> [<miner-addr> "
|
||||
"<output-ext-msg-boc>]\n"
|
||||
"<output-ext-msg-boc>] [-V]\n"
|
||||
"Outputs a valid <rdata> value for proof-of-work testgiver after computing at most <iterations> hashes "
|
||||
"or terminates with non-zero exit code\n";
|
||||
std::exit(2);
|
||||
|
@ -156,7 +156,7 @@ int main(int argc, char* const argv[]) {
|
|||
progname = argv[0];
|
||||
int i, threads = 0;
|
||||
bool bounce = false, benchmark = false;
|
||||
while ((i = getopt(argc, argv, "bnvw:t:Bh")) != -1) {
|
||||
while ((i = getopt(argc, argv, "bnvw:t:Bh:V")) != -1) {
|
||||
switch (i) {
|
||||
case 'v':
|
||||
++verbosity;
|
||||
|
@ -180,6 +180,10 @@ int main(int argc, char* const argv[]) {
|
|||
case 'n':
|
||||
bounce = false;
|
||||
break;
|
||||
case 'V':
|
||||
std::cout << "pow-miner build information: [ Commit: " << GitMetadata::CommitSHA1() << ", Date: " << GitMetadata::CommitDate() << "]\n";
|
||||
std::exit(0);
|
||||
break;
|
||||
case 'h':
|
||||
return usage();
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue