6
0
mirror of https://github.com/JKornev/hidden synced 2024-06-16 12:08:05 +00:00
hidden/HiddenCLI/HiddenCLI.cpp

41 lines
665 B
C++
Raw Normal View History

2016-07-21 23:02:31 +00:00
#include <Windows.h>
#include <iostream>
#include <stdio.h>
2016-12-04 19:27:46 +00:00
#include "Helper.h"
#include "Connection.h"
#include "Commands.h"
2016-07-21 23:02:31 +00:00
#include "../HiddenLib/HiddenLib.h"
using namespace std;
2016-12-04 19:27:46 +00:00
int wmain(int argc, wchar_t* argv[])
2016-07-21 23:02:31 +00:00
{
2016-12-04 19:27:46 +00:00
try
2016-07-21 23:02:31 +00:00
{
2016-12-04 19:27:46 +00:00
Arguments arguments(argc, argv);
2016-07-21 23:02:31 +00:00
2016-12-04 19:27:46 +00:00
if (!arguments.ArgsCount())
throw WException(
-2,
L"Welcome to HiddenCLI, please use 'hiddencli help'"
);
2016-07-21 23:02:31 +00:00
2016-12-04 19:27:46 +00:00
Connection connection(arguments);
Commands commands(arguments);
2016-07-21 23:02:31 +00:00
}
2016-12-04 19:27:46 +00:00
catch (WException& exception)
{
2016-12-04 19:27:46 +00:00
wcerr << exception.What() << endl;
return exception.Code();
}
2016-12-04 19:27:46 +00:00
catch (exception& exception)
{
2016-12-04 19:27:46 +00:00
cerr << exception.what() << endl;
return -1;
}
2016-07-21 23:02:31 +00:00
return 0;
}