drogon/drogon_ctl/main.cc

39 lines
706 B
C++
Raw Normal View History

2018-05-31 17:00:31 +08:00
/**
*
* @file
* @author An Tao
* @section LICENSE
*
* Copyright 2018, An Tao. All rights reserved.
* Use of this source code is governed by a MIT license
* that can be found in the License file.
*
* @section DESCRIPTION
* this is a drogon lib tool program
* run drogon_ctl help to get usage
*/
#include "cmd.h"
2018-05-28 14:34:47 +08:00
#include <string>
#include <vector>
#include <iostream>
2018-10-14 15:56:54 +08:00
int main(int argc, char *argv[])
2018-05-28 14:34:47 +08:00
{
2018-10-14 15:56:54 +08:00
if (argc < 2)
2018-05-28 14:34:47 +08:00
{
2018-10-14 15:56:54 +08:00
std::vector<std::string> args = {"help"};
2018-05-30 17:44:09 +08:00
exeCommand(args);
2018-05-28 14:34:47 +08:00
return 0;
}
std::vector<std::string> args;
2018-10-14 15:56:54 +08:00
for (int i = 1; i < argc; i++)
2018-05-28 14:34:47 +08:00
{
args.push_back(argv[i]);
2018-05-28 14:34:47 +08:00
}
exeCommand(args);
2018-05-28 14:34:47 +08:00
return 0;
}