Add a --version flag to lokinet CLI args

pull/851/head
Stephen Shelton 5 years ago
parent a50c80070c
commit c9b862a12b

@ -1,4 +1,5 @@
#include <config/config.hpp> // for ensure_config
#include <constants/version.hpp>
#include <llarp.h>
#include <util/fs.hpp>
#include <util/logging/logger.hpp>
@ -134,6 +135,7 @@ main(int argc, char *argv[])
options.add_options()
("v,verbose", "Verbose", cxxopts::value<bool>())
("h,help", "help", cxxopts::value<bool>())
("version", "version", cxxopts::value<bool>())
("g,generate", "generate client config", cxxopts::value<bool>())
("r,router", "generate router config", cxxopts::value<bool>())
("f,force", "overwrite", cxxopts::value<bool>())
@ -172,6 +174,12 @@ main(int argc, char *argv[])
return 0;
}
if(result.count("version"))
{
std::cout << LLARP_VERSION << std::endl;
return 0;
}
if(result.count("generate") > 0)
{
genconfigOnly = true;

Loading…
Cancel
Save