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
|
@ -34,6 +34,7 @@
|
|||
#include "vm/cp0.h"
|
||||
#include "td/utils/crypto.h"
|
||||
#include <getopt.h>
|
||||
#include "git.h"
|
||||
|
||||
using td::Ref;
|
||||
using namespace std::literals::string_literals;
|
||||
|
@ -144,7 +145,7 @@ int main(int argc, char* const argv[]) {
|
|||
int i, vseqno_incr = 1;
|
||||
int new_verbosity_level = VERBOSITY_NAME(INFO);
|
||||
std::string in_fname, out_fname;
|
||||
while ((i = getopt(argc, argv, "hi:v:")) != -1) {
|
||||
while ((i = getopt(argc, argv, "hi:v:V")) != -1) {
|
||||
switch (i) {
|
||||
case 'h':
|
||||
usage();
|
||||
|
@ -156,6 +157,10 @@ int main(int argc, char* const argv[]) {
|
|||
case 'v':
|
||||
new_verbosity_level = VERBOSITY_NAME(FATAL) + (verbosity = td::to_integer<int>(td::Slice(optarg)));
|
||||
break;
|
||||
case 'V':
|
||||
std::cout << "adjust-block build information: [ Commit: " << GitMetadata::CommitSHA1() << ", Date: " << GitMetadata::CommitDate() << "]\n";
|
||||
std::exit(0);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue