mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 01:07:54 +00:00
first
This commit is contained in:
49
main.cpp
Normal file
49
main.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "Application.h"
|
||||
#include <iostream>
|
||||
#include "CallRPC.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
/*
|
||||
Detect if another is running
|
||||
If so message it with the users command
|
||||
*/
|
||||
|
||||
|
||||
void startApp()
|
||||
{
|
||||
theApp=new Application();
|
||||
theApp->run(); // blocks till we get a stop RPC
|
||||
}
|
||||
|
||||
void printHelp()
|
||||
{
|
||||
cout << "newcoin [options] <command> <params>" << endl;
|
||||
cout << "options: " << endl;
|
||||
cout << " -" << endl;
|
||||
cout << "commands: " << endl;
|
||||
cout << " stop" << endl;
|
||||
cout << " send <address> <amount>" << endl;
|
||||
cout << " getinfo" << endl;
|
||||
cout << " getbalance" << endl;
|
||||
|
||||
}
|
||||
|
||||
int parseCommandline(int argc, char* argv[])
|
||||
{
|
||||
int ret=0;
|
||||
if(argc>1)
|
||||
{
|
||||
ret=commandLineRPC(argc, argv);
|
||||
if(!ret) printHelp();
|
||||
}else startApp();
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
return(parseCommandline(argc,argv));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user