Merge pull request #179 from an-tao/dev

Modify the parameters of drogon_ctl command
This commit is contained in:
An Tao 2019-06-22 22:39:45 +08:00 committed by GitHub
commit 4f975dd7ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -38,6 +38,7 @@ addons:
- postgresql
- mariadb
- sqlite3
update: true
script:
- ./build.sh && ./test.sh

View File

@ -21,7 +21,8 @@ void help::handleCommand(std::vector<std::string> &parameters)
{
if (parameters.size() == 0)
{
std::cout << "usage: drogon_ctl <command> [<args>]" << std::endl;
std::cout << "usage: drogon_ctl [-v | --version] [-h | --help] <command> [<args>]"
<< std::endl;
std::cout << "commands list:" << std::endl;
for (auto &className : drogon::DrClassMap::getAllClassName())
{

View File

@ -31,6 +31,17 @@ int main(int argc, char *argv[])
{
args.push_back(argv[i]);
}
for (auto &arg : args)
{
if (arg == "-h" || arg == "--help")
{
arg = "help";
}
else if (arg == "-v" || arg == "--version")
{
arg = "version";
}
}
exeCommand(args);