implement argv handler and basic mpc commands

This commit is contained in:
unK
2008-10-05 22:41:29 +02:00
parent 9fd373625d
commit 4ab4e72c97
7 changed files with 152 additions and 13 deletions

View File

@@ -160,12 +160,22 @@ int main(int argc, char *argv[])
Mpd->SetTimeout(Config.mpd_connection_timeout);
if (!Mpd->Connect())
if (argc > 1)
{
printf("Cannot connect to mpd: %s\n", Mpd->GetLastErrorMessage().c_str());
return -1;
vector<string> args;
args.reserve(argc-1);
for (int i = 1; i < argc; i++)
args.push_back(argv[i]);
if (ParseArgv(args))
{
Mpd->Disconnect();
return 0;
}
}
if (!ConnectToMPD())
return -1;
setlocale(LC_ALL,"");
initscr();
noecho();