3434#include < cstdlib>
3535#include < future>
3636#include < ios>
37+ #include < optional>
3738#include < unistd.h>
39+ #include < vector>
3840
3941int main (int argc, char ** argv)
4042{
4143 auto & appConfig = GetAppConfig ();
4244
4345 Firebolt::LogLevel logLevel = Firebolt::LogLevel::Notice;
4446 std::string url;
47+ std::optional<bool > legacyRPCv1;
4548
4649 for (int i = 1 ; i < argc; ++i)
4750 {
@@ -66,6 +69,14 @@ int main(int argc, char** argv)
6669 }
6770 url = argv[++i];
6871 }
72+ else if (std::string (argv[i]) == " --legacy" )
73+ {
74+ legacyRPCv1 = true ;
75+ }
76+ else if (std::string (argv[i]) == " --rpc-v2" )
77+ {
78+ legacyRPCv1 = false ;
79+ }
6980 else if (std::string (argv[i]) == " --dbg" )
7081 {
7182 logLevel = Firebolt::LogLevel::Debug;
@@ -81,6 +92,8 @@ int main(int argc, char** argv)
8192 std::cout << " --mock Connect to a local mock server instead of the default Firebolt Demo Service" << std::endl;
8293 std::cout << " --platform Connect to the platform's Firebolt service (default if available)" << std::endl;
8394 std::cout << " --url <URL> Specify a custom URL for the Firebolt service" << std::endl;
95+ std::cout << " --legacy Use legacy communication" << std::endl;
96+ std::cout << " --rpc-v2 Use JSON-RPC compliant communication" << std::endl;
8497 std::cout << " --dbg Enable debug logging" << std::endl;
8598 std::cout << " --help Show this help message" << std::endl;
8699 /* clang-format on */
@@ -106,6 +119,10 @@ int main(int argc, char** argv)
106119 config.wsUrl = url;
107120 config.waitTime_ms = 1000 ;
108121 config.log .level = logLevel;
122+ if (legacyRPCv1.has_value ())
123+ {
124+ config.legacyRPCv1 = legacyRPCv1.value ();
125+ }
109126
110127 std::promise<bool > connectionPromise;
111128 std::once_flag connectionOnce;
0 commit comments