Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --nocache option to force a bugzilla query. #106

Merged
merged 1 commit into from Jan 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions changed.d
Original file line number Diff line number Diff line change
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)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know, "not-no" ain't pretty. Couldn't think of a better name at these late hours.

{
changeLog = (cast(string)read(cachePath)).strip;
}
Expand Down