improve parsing argv a bit

This commit is contained in:
Andrzej Rybczak
2008-11-04 16:10:02 +01:00
parent 80aba9295a
commit 5b1dbf2aed
3 changed files with 8 additions and 7 deletions

View File

@@ -65,11 +65,16 @@ bool ConnectToMPD()
return true;
}
bool ParseArgv(vector<string> &v)
bool ParseArgv(int argc, char **argv)
{
using std::cout;
using std::endl;
vector<string> v;
v.reserve(argc-1);
for (int i = 1; i < argc; i++)
v.push_back(argv[i]);
bool exit = 0;
for (vector<string>::iterator it = v.begin(); it != v.end() && !exit; it++)
{