Commit 22a71ecf authored by Marcin Sobczyk's avatar Marcin Sobczyk
Browse files

Add option --version in cli_wallet

parent 04a6ddc1
......@@ -39,6 +39,7 @@
#include <fc/rpc/websocket_api.hpp>
#include <fc/smart_ref_impl.hpp>
#include <hive/utilities/git_revision.hpp>
#include <hive/utilities/key_conversion.hpp>
#include <hive/protocol/protocol.hpp>
......@@ -87,6 +88,7 @@ int main( int argc, char** argv )
boost::program_options::options_description opts;
opts.add_options()
("help,h", "Print this help message and exit.")
("version,v", "Print git revision sha of this cli_wallet build.")
("offline,o", "Run the wallet in offline mode.")
("server-rpc-endpoint,s", bpo::value<string>()->default_value("ws://127.0.0.1:8090"), "Server websocket RPC endpoint")
("cert-authority,a", bpo::value<string>()->default_value("_default"), "Trusted CA bundle file for connecting to wss:// TLS server")
......@@ -114,6 +116,11 @@ int main( int argc, char** argv )
std::cout << opts << "\n";
return 0;
}
if( options.count("version") )
{
std::cout << "hive_git_revision: " << std::string( hive::utilities::git_revision_sha ) << "\n";
return 0;
}
if( options.count("rpc-http-allowip") && options.count("rpc-http-endpoint") ) {
allowed_ips = options["rpc-http-allowip"].as<vector<string>>();
wdump((allowed_ips));
......
......@@ -6,10 +6,10 @@ from test_tools import logger, paths_to_executables
def test_help_option():
only_args_to_be_founded = [
'--help', '--offline', '--server-rpc-endpoint', '--cert-authority',
'--retry-server-connection', '--rpc-endpoint', '--rpc-tls-endpoint',
'--rpc-tls-certificate', '--rpc-http-endpoint', '--unlock',
'--daemon', '--rpc-http-allowip', '--wallet-file', '--chain-id', '--format-type'
'--help', '--version', '--offline', '--server-rpc-endpoint',
'--cert-authority', '--retry-server-connection', '--rpc-endpoint', '--rpc-tls-endpoint',
'--rpc-tls-certificate', '--rpc-http-endpoint', '--unlock', '--daemon',
'--rpc-http-allowip', '--wallet-file', '--chain-id', '--format-type'
]
cli_wallet_path = paths_to_executables.get_path_of('cli_wallet')
......@@ -40,6 +40,7 @@ def test_wallet_help_default_values():
default_values[parameter] = default_value[1] if default_value is not None else None
assert default_values['--help'] is None
assert default_values['--version'] is None
assert default_values['--offline'] is None
assert default_values['--server-rpc-endpoint'] == 'ws://127.0.0.1:8090'
assert default_values['--cert-authority'] == '_default'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment