mirror of https://github.com/PatrickLipka/tt.git
Added bold output in report
This commit is contained in:
parent
3a3a184b5e
commit
3436069b7c
3
Makefile
3
Makefile
|
@ -1,6 +1,7 @@
|
|||
-include config.out
|
||||
|
||||
CXX ?= g++
|
||||
CPPFLAGS ?= -DFORMATTED_TEXT
|
||||
CXXFLAGS := -std=c++11 -g -Wall -pedantic
|
||||
OBJFLAGS := $(CXXFLAGS) -c
|
||||
LDFLAGS := -lreadline
|
||||
|
@ -21,7 +22,7 @@ $(BIN_PATH)/tt: $(OBJ)
|
|||
$(CXX) $(CXXFLAGS) -o $@ $(OBJ) $(LDFLAGS)
|
||||
|
||||
$(SRC_PATH)/%.o: $(SRC_PATH)/%.cpp
|
||||
$(CXX) -DPREFIX=$(PREFIX) $(OBJFLAGS) -o $@ $<
|
||||
$(CXX) -DPREFIX=$(PREFIX) $(CPPFLAGS) $(OBJFLAGS) -o $@ $<
|
||||
|
||||
makedir:
|
||||
@mkdir -p $(BIN_PATH)
|
||||
|
|
|
@ -26,6 +26,7 @@ The following variables can be used to configure the build:
|
|||
* `PREFIX` - install prefix, defaults to `/usr/local`
|
||||
* `USER_NAME` - user name to be mentioned in monthly reports, defaults to `$USER`
|
||||
* `TRACKING_DIR` - directory where tracking files are saved, defaults to `$HOME/track`
|
||||
* `CPPFLAGS` - set to `-UFORMATTED_TEXT` if your terminal does not support usual Unix escape sequences
|
||||
|
||||
The user name and tracking directory can also be set after installation by modifying `$PREFIX/etc/tt.conf`
|
||||
|
||||
|
|
2
src/tt.h
2
src/tt.h
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#define TT_VERSION 1.2.0
|
||||
#define TT_VERSION 1.2.0_dev
|
||||
#define TT_IO_VERSION 120
|
||||
|
||||
// global variables:
|
||||
|
|
|
@ -591,13 +591,13 @@ void command_report(std::string date_str, ProjectList* proj_list){
|
|||
Project *proj = &(proj_list->projects[i]);
|
||||
float wtime_proj = proj->get_total_work_time() / 3600.0;
|
||||
if(wtime_proj >= 0.01){
|
||||
std::cout << "Project: " << proj->name << std::endl;
|
||||
std::cout << "Project: " << TERM_BOLD << proj->name << TERM_RESET << std::endl;
|
||||
for(int j=0; j<proj->num_tasks; j++){
|
||||
float wtime_task = proj->tasks[j].work_time / 3600.0;
|
||||
if(wtime_task >= 0.01) std::cout << "--- " << proj->tasks[j].name << ": " << std::fixed << std::setprecision(2) << wtime_task << std::endl;
|
||||
}
|
||||
// format: *.xx hours
|
||||
std::cout << "Total: " << std::fixed << std::setprecision(2) << wtime_proj << std::endl << std::endl;
|
||||
std::cout << TERM_BOLD << "Total: " << std::fixed << std::setprecision(2) << wtime_proj << TERM_RESET << std::endl << std::endl;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
@ -611,13 +611,13 @@ void command_report(std::string date_str, ProjectList* proj_list){
|
|||
Project *proj = &(list.projects[i]);
|
||||
float wtime_proj = proj->get_total_work_time() / 3600.0;
|
||||
if(wtime_proj >= 0.01){
|
||||
std::cout << "Project: " << proj->name << std::endl;
|
||||
std::cout << "Project: " << TERM_BOLD << proj->name << TERM_RESET << std::endl;
|
||||
for(int j=0; j<proj->num_tasks; j++){
|
||||
float wtime_task = proj->tasks[j].work_time / 3600.0;
|
||||
if(wtime_task >= 0.01) std::cout << "--- " << proj->tasks[j].name << ": " << std::fixed << std::setprecision(2) << wtime_task << std::endl;
|
||||
}
|
||||
// format: *.xx hours
|
||||
std::cout << "Total: " << std::fixed << std::setprecision(2) << wtime_proj << std::endl << std::endl;
|
||||
std::cout << TERM_BOLD << "Total: " << std::fixed << std::setprecision(2) << wtime_proj << TERM_RESET << std::endl << std::endl;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
|
Loading…
Reference in New Issue