Skip to content

Commit 69ebc10

Browse files
committed
Add hours per day option
1 parent a1c5c19 commit 69ebc10

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ gtt report --time_format="[%sign][%days>d ][%hours>h ][%minutes>m ][%seconds>s]"
384384

385385
*Note: [Click here](#time-format) for a further documentation on the time format.*
386386

387+
#### Set hours per day
388+
389+
```shell
390+
gtt report --hours_per_day=6
391+
```
392+
387393
#### Set columns included in the time record table
388394

389395
```shell

src/gtt-log.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ const Cli = require('./include/cli');
88
const Time = require('./models/time');
99
const Tasks = require('./include/tasks');
1010

11-
program.option('--verbose', 'show verbose output')
11+
program
12+
.option('--verbose', 'show verbose output')
13+
.option('--hours_per_day <hours>', 'hours per day for human readable time formats')
1214
.parse(process.argv);
1315

1416
Cli.verbose = program.verbose;
1517

16-
let config = new Config(__dirname),
18+
let config = new Config(__dirname)
19+
.set('hoursPerDay', program.hours_per_day),
1720
tasks = new Tasks(config);
1821

1922
function toHumanReadable(input) {

src/gtt-report.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ program
4444
.option('--exclude_labels <labels>', 'exclude the given labels in the report', collect, null)
4545
.option('--date_format <date>', 'use the given date format in the report', collect, null)
4646
.option('--time_format <time>', 'use the given time format in the report')
47+
.option('--hours_per_day <hours>', 'hours per day for human readable time formats')
4748
.option('--no_headlines', 'hide headlines in the report')
4849
.option('--no_warnings', 'hide warnings in the report')
4950
.option('--record_columns <columns>', 'include the given columns in the record part of the report', collect, null)
@@ -76,6 +77,7 @@ config
7677
.set('excludeLabels', program.exclude_labels)
7778
.set('dateFormat', program.date_format)
7879
.set('timeFormat', program.time_format)
80+
.set('hoursPerDay', program.hours_per_day)
7981
.set('output', program.output)
8082
.set('file', program.file)
8183
.set('query', program.query)

0 commit comments

Comments
 (0)