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:
parent
43e7b3fec0
commit
17b3ea471d
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* main.cc
|
* @file main.cc
|
||||||
* An Tao
|
* @author An Tao
|
||||||
*
|
*
|
||||||
* Copyright 2018, An Tao. All rights reserved.
|
* Copyright 2018, An Tao. All rights reserved.
|
||||||
* https://github.com/an-tao/drogon
|
* https://github.com/an-tao/drogon
|
||||||
|
@ -19,13 +19,13 @@
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
std::vector<std::string> args;
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
std::vector<std::string> args = {"help"};
|
args = {"help"};
|
||||||
exeCommand(args);
|
exeCommand(args);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
std::vector<std::string> args;
|
|
||||||
for (int i = 1; i < argc; ++i)
|
for (int i = 1; i < argc; ++i)
|
||||||
{
|
{
|
||||||
args.push_back(argv[i]);
|
args.push_back(argv[i]);
|
||||||
|
|
Loading…
Reference in New Issue