Skip to content

Commit

Permalink
Merge pull request #331 from dawgfoto/fix285
Browse files Browse the repository at this point in the history
fix Issue #285 - getOption returns false when option is set on command l...
  • Loading branch information
s-ludwig committed Oct 3, 2013
2 parents 683278c + a37d7d3 commit 5b661d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/vibe/core/args.d
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,19 @@ bool getOption(T)(string names, T* pvalue, string help_text)
assert(!g_options.any!(o => o.names == info.names)(), "getOption() may only be called once per option name.");
g_options ~= info;

immutable olen = g_args.length;
getopt(g_args, getoptConfig, names, pvalue);
immutable found = olen > g_args.length;

if (g_haveConfig) {
foreach (name; info.names)
if (auto pv = name in g_config) {
*pvalue = pv.to!T;
return true;
break;
}
}

return false;
return found;
}


Expand Down

0 comments on commit 5b661d5

Please sign in to comment.