Skip to content

Commit

Permalink
finished implementing output of current day's tracks' data as CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
kstenschke committed Nov 15, 2019
1 parent 673596b commit 62d3819
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Binary file modified bin/mac/ttt
Binary file not shown.
19 changes: 14 additions & 5 deletions src/ttt/class/app/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ bool App::Process() {
return false;
}

return keep_backup ? ReportFile::ActivateTemporaryBackup() : ReportFile::RemoveTemporaryBackup();
return keep_backup
? ReportFile::ActivateTemporaryBackup()
: ReportFile::RemoveTemporaryBackup();
}

/** @todo check: "d" command crashes when current day has less time left than a full-day entry spans? */
Expand Down Expand Up @@ -158,8 +160,10 @@ bool App::BrowseTaskUrl() {
}

return browser->BrowseTaskUrlsInScope(
static_cast<ReportRendererCli::RenderScopes>(arguments_->render_scope_), arguments_->GetNegativeNumber(),
arguments_->GetTaskNumber(), url_command);
static_cast<ReportRendererCli::RenderScopes>(arguments_->render_scope_),
arguments_->GetNegativeNumber(),
arguments_->GetTaskNumber(),
url_command);
}

bool App::DisplayDate() {
Expand Down Expand Up @@ -204,7 +208,10 @@ bool App::Merge() {
if (last_row_index==0)
return tictac_track::AppError::PrintError("Cannot merge: There's only one entry.");

int row_index = 2==arguments_->argc_ ? last_row_index - 1 : arguments_->ResolveNumber(2);
int row_index = 2==arguments_->argc_
? last_row_index - 1
: arguments_->ResolveNumber(2);

if (row_index < 0)
return tictac_track::AppError::PrintError("Cannot merge: Entry index cannot be < 0.");

Expand Down Expand Up @@ -700,11 +707,13 @@ bool App::CsvRecentTaskNumbers() {
bool App::CsvTodayTracks() {
ReportRendererCsv renderer;

return renderer.RenderToStdOut(static_cast<ReportRendererCli::RenderScopes>(arguments_->render_scope_));
return renderer.RenderToStdOut(
static_cast<ReportRendererCli::RenderScopes>(arguments_->render_scope_));
}

/**
* View entries sequentially, opening related task URL at the same time
* @see AppConfig::GetDefaultConfig() Base URL, e.g. redmine is set within ini
*/
bool App::BrowseDayTasks() {
ReportRendererCli renderer;
Expand Down
1 change: 1 addition & 0 deletions src/ttt/class/report/report_renderer_csv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ bool ReportRendererCsv::RenderToStdOut(RenderScopes scope) {

std::string csv = RenderCsv(scope);
if (!csv.empty()) {
helper::String::ReplaceAll(csv, "\"\"\n", "\"\n");
std::cout << csv;
return true;
}
Expand Down

0 comments on commit 62d3819

Please sign in to comment.