Skip to content
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.

Commit

Permalink
"better" outdir parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
circleous committed Jul 27, 2017
1 parent 4717fe4 commit 11c5930
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ int main(int argc, char* argv[])
bool all = false;

std::string outdir = input.getCmdOption("-d");
if (outdir.empty())
if (outdir.empty()) {
outdir = '.';
} else {
if (outdir.back() == '/')
outdir.erase(outdir.end() - 1);
if (outdir.front() != '/')
outdir.insert(0, "./");
}

if (input.cmdOptionExists("--all") || input.cmdOptionExists("-a"))
all = true;
Expand Down

0 comments on commit 11c5930

Please sign in to comment.