Merge pull request #253 from hinto-janai/master

Add `--version`
This commit is contained in:
SChernykh 2023-04-17 20:02:01 +02:00 committed by GitHub
commit 93365973a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View file

@ -29,6 +29,7 @@
--no-upnp Disable UPnP port forwarding --no-upnp Disable UPnP port forwarding
--no-igd An alias for --no-upnp --no-igd An alias for --no-upnp
--upnp-stratum Port forward Stratum port (it's not forwarded by default) --upnp-stratum Port forward Stratum port (it's not forwarded by default)
--version Print p2pool's version and build details
``` ```
### Example command line ### Example command line

View file

@ -58,6 +58,7 @@ void p2pool_usage()
"--no-igd An alias for --no-upnp\n" "--no-igd An alias for --no-upnp\n"
"--upnp-stratum Port forward Stratum port (it's not forwarded by default)\n" "--upnp-stratum Port forward Stratum port (it's not forwarded by default)\n"
#endif #endif
"--version Print p2pool's version and build details\n"
"--help Show this help message\n\n" "--help Show this help message\n\n"
"Example command line:\n\n" "Example command line:\n\n"
"%s --host 127.0.0.1 --rpc-port 18081 --zmq-port 18083 --wallet YOUR_WALLET_ADDRESS --stratum 0.0.0.0:%d --p2p 0.0.0.0:%d\n\n", "%s --host 127.0.0.1 --rpc-port 18081 --zmq-port 18083 --wallet YOUR_WALLET_ADDRESS --stratum 0.0.0.0:%d --p2p 0.0.0.0:%d\n\n",
@ -75,6 +76,11 @@ void p2pool_usage()
); );
} }
void p2pool_version()
{
printf("P2Pool %s\n", p2pool::VERSION);
}
void memory_tracking_start(); void memory_tracking_start();
void memory_tracking_stop(); void memory_tracking_stop();
@ -90,6 +96,11 @@ int main(int argc, char* argv[])
p2pool_usage(); p2pool_usage();
return 0; return 0;
} }
if (strcmp(argv[i], "--version") || strcmp(argv[i], "/version") || strcmp(argv[i], "-v") || strcmp(argv[i], "/v")) {
p2pool_version();
return 0;
}
} }
memory_tracking_start(); memory_tracking_start();

View file

@ -280,6 +280,7 @@ struct PerfTimer
void memory_tracking_start(); void memory_tracking_start();
void memory_tracking_stop(); void memory_tracking_stop();
void p2pool_usage(); void p2pool_usage();
void p2pool_version();
namespace robin_hood { namespace robin_hood {