42 lines
1.6 KiB
C++
42 lines
1.6 KiB
C++
#include "lib/testing/catch_test_runner.h"
|
|
#include "lib/utils/init_spark_lib.h"
|
|
#include "server/sparkd/cmds/AdminReport.h"
|
|
#include "server/sparkd/cmds/Benchmark.h"
|
|
#include "server/sparkd/cmds/ConfigCheck.h"
|
|
#include "server/sparkd/cmds/KeyCode.h"
|
|
#include "server/sparkd/cmds/Md.h"
|
|
#include "server/sparkd/cmds/QuickTest.h"
|
|
#include "server/sparkd/cmds/Run.h"
|
|
#include "server/sparkd/cmds/Spartan.h"
|
|
#include "server/sparkd/cmds/Web.h"
|
|
#include "server/sparkd/cmds/crypto/CryptoCmd.h"
|
|
#include <CLI11/CLI11.hpp>
|
|
|
|
using namespace bts;
|
|
|
|
int main(int argc, char **argv) {
|
|
utils::SparkLibInit init;
|
|
|
|
// The catch testing framework has its own command line parser so
|
|
// if we are testing we just forward the entire command to catch
|
|
if (argc > 1 && std::string(argv[1]) == "test")
|
|
return run_tests(argc, argv);
|
|
else {
|
|
CLI::App app("Futures trading system", "sparkd");
|
|
app.require_subcommand();
|
|
app.add_subcommand(CLI::App_p(new cmds::AdminReport()));
|
|
app.add_subcommand(CLI::App_p(new cmds::Benchmark()));
|
|
app.add_subcommand(CLI::App_p(new cmds::CryptoCmd()));
|
|
app.add_subcommand(CLI::App_p(new cmds::ConfigCheck()));
|
|
app.add_subcommand(CLI::App_p(new cmds::Md()));
|
|
app.add_subcommand(CLI::App_p(new cmds::QuickTest()));
|
|
app.add_subcommand(CLI::App_p(new cmds::Run()));
|
|
app.add_subcommand(CLI::App_p(new cmds::Spartan()));
|
|
app.add_subcommand((CLI::App_p(new cmds::KeyCode())));
|
|
// app.add_subcommand(CLI::App_p(new cmds::Web()));
|
|
app.add_subcommand(
|
|
"test", "Run unit test(s)"); // so this shows up in help
|
|
CLI11_PARSE(app, argc, argv);
|
|
}
|
|
}
|