mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Merge pull request #851 from notlesh/add_version_cli_arg
Add a --version flag to lokinet CLI args
This commit is contained in:
commit
b8239a3c23
1 changed files with 8 additions and 0 deletions
|
@ -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…
Reference in a new issue