Remove duplicate definition of `args` vector. (#609)

* Remove duplicate definition of `args` vector.

Removed duplicate definition of the variable `args` which could be defined in the first line rather than defining once in the if scope and once in the main function.
This commit is contained in:
Amirali Amirifar 2020-10-13 05:59:01 +03:30 committed by GitHub
parent 43e7b3fec0
commit 17b3ea471d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/**
*
* main.cc
* An Tao
* @file main.cc
* @author An Tao
*
* Copyright 2018, An Tao. All rights reserved.
* https://github.com/an-tao/drogon
@ -19,13 +19,13 @@
int main(int argc, char *argv[])
{
std::vector<std::string> args;
if (argc < 2)
{
std::vector<std::string> args = {"help"};
args = {"help"};
exeCommand(args);
return 0;
}
std::vector<std::string> args;
for (int i = 1; i < argc; ++i)
{
args.push_back(argv[i]);