Skip to content

Commit

Permalink
Cleanup|libdeng2: Use CommandLine::ArgWithParams
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 11, 2014
1 parent b7fa8db commit d689534
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions doomsday/libdeng2/src/core/app.cpp
Expand Up @@ -264,10 +264,9 @@ DENG2_PIMPL(App)

void checkForErrorDumpFile()
{
int pos = cmdLine.check("-errors", 1);
if(pos > 0)
if(CommandLine::ArgWithParams arg = cmdLine.check("-errors", 1))
{
File &errors = self.rootFolder().replaceFile(Path("/home") / cmdLine.at(pos + 1));
File &errors = self.rootFolder().replaceFile(Path("/home") / arg.params.at(0));
errorSink.reset(new FileLogSink(errors));
errorSink->setMode(LogSink::OnlyWarningEntries);
logBuffer.addSink(*errorSink);
Expand Down Expand Up @@ -554,10 +553,9 @@ void App::initSubsystems(SubsystemInitFlags flags)
try
{
// The -out option can be used to override the configured output file.
int pos = 0;
if((pos = commandLine().check("-out", 1)) > 0)
if(CommandLine::ArgWithParams outArg = commandLine().check("-out", 1))
{
logBuf.setOutputFile(String("/home") / commandLine().at(pos + 1));
logBuf.setOutputFile(String("/home") / outArg.params.at(0));
}
else
{
Expand Down

0 comments on commit d689534

Please sign in to comment.