Merge pull request #179 from an-tao/dev
Modify the parameters of drogon_ctl command
This commit is contained in:
commit
4f975dd7ef
|
@ -38,6 +38,7 @@ addons:
|
|||
- postgresql
|
||||
- mariadb
|
||||
- sqlite3
|
||||
update: true
|
||||
|
||||
script:
|
||||
- ./build.sh && ./test.sh
|
||||
|
|
|
@ -21,7 +21,8 @@ void help::handleCommand(std::vector<std::string> ¶meters)
|
|||
{
|
||||
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())
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue