创建工程并增加了json支持

This commit is contained in:
zjk
2024-10-22 17:28:15 +08:00
parent 985b667200
commit dfd13848ef
20 changed files with 959 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
/************************************************************/
/* NAME: */
/* ORGN: MIT, Cambridge MA */
/* FILE: main.cpp, Cambridge MA */
/* DATE: December 29th, 1963 */
/************************************************************/
#include <string>
#include "MBUtils.h"
#include "ColorParse.h"
#include "PowerManger.h"
#include "PowerManger_Info.h"
using namespace std;
int main(int argc, char *argv[])
{
string mission_file;
string run_command = argv[0];
for(int i=1; i<argc; i++) {
string argi = argv[i];
if((argi=="-v") || (argi=="--version") || (argi=="-version"))
showReleaseInfoAndExit();
else if((argi=="-e") || (argi=="--example") || (argi=="-example"))
showExampleConfigAndExit();
else if((argi == "-h") || (argi == "--help") || (argi=="-help"))
showHelpAndExit();
else if((argi == "-i") || (argi == "--interface"))
showInterfaceAndExit();
else if(strEnds(argi, ".moos") || strEnds(argi, ".moos++"))
mission_file = argv[i];
else if(strBegins(argi, "--alias="))
run_command = argi.substr(8);
else if(i==2)
run_command = argi;
}
if(mission_file == "")
showHelpAndExit();
cout << termColor("green");
cout << "pPowerManger launching as " << run_command << endl;
cout << termColor() << endl;
PowerManger PowerManger;
PowerManger.Run(run_command.c_str(), mission_file.c_str());
return(0);
}