Skip to content

Commit

Permalink
Merge pull request #106 from AndrejMitrovic/AddForce
Browse files Browse the repository at this point in the history
Add --nocache option to force a bugzilla query.
  • Loading branch information
MartinNowak committed Jan 8, 2014
2 parents 65d2fa3 + 88adbdb commit a36e702
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions changed.d
Expand Up @@ -17,6 +17,10 @@ Example usage:
rdmd changed.d --start=2013-01-01 --end=2013-04-01
rdmd changed.d --start=2013-01-01 (end date implicitly set to current date)
---
$(B Note:) The script will cache the results of an invocation, to avoid
re-querying bugzilla when invoked with the same arguments.
Use the --nocache option to override this behavior.
*/

// NOTE: this script requires libcurl to be linked in (usually done by default).
Expand Down Expand Up @@ -162,9 +166,11 @@ int main(string[] args)
{
string start_date, end_date;
bool ddoc = false;
bool nocache; // don't read from cache
getopt(args,
"start", &start_date, // numeric
"end", &end_date); // string
"nocache", &nocache,
"start", &start_date, // numeric
"end", &end_date); // string

if (start_date.empty)
{
Expand All @@ -181,7 +187,7 @@ int main(string[] args)
string cachePath = getCachePath(to!string(start), to!string(end));
debug stderr.writefln("Cache file: %s\nCache file found: %s", cachePath, cachePath.exists);
string changeLog;
if (cachePath.exists)
if (!nocache && cachePath.exists)
{
changeLog = (cast(string)read(cachePath)).strip;
}
Expand Down

0 comments on commit a36e702

Please sign in to comment.