Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,10 @@ gtt report --output=markdown
gtt report --output=csv
gtt report --output=pdf --file=filename.pdf
gtt report --output=xlsx --file=filename.xlsx
gtt report --output=sqlite --file=filename.sqlite
```

Defaults to `table`. `csv` and `markdown` can be printed to stdout, `pdf` and `xlsx` need the file parameter.
Defaults to `table`. `csv` and `markdown` can be printed to stdout, `pdf`, `xlsx` and `sqlite` need the file parameter.

#### Print the output to a file

Expand Down Expand Up @@ -589,7 +590,7 @@ timeFormat:
timezone: "Europe/Berlin"

# Output type
# Available: csv, table, markdown, pdf, xlsx
# Available: csv, table, markdown, pdf, xlsx, sqlite
# defaults to table
output: markdown

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"request": "^2.87.0",
"request-promise-native": "^1.0.4",
"shelljs": "^0.8.3",
"sqlite3": "^4.0.6",
"tempfile": "^2.0.0",
"underscore": "^1.9.1",
"xdg-basedir": "^3.0.0",
Expand Down
7 changes: 6 additions & 1 deletion src/gtt-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const Output = {
pdf: require('./output/pdf'),
markdown: require('./output/markdown'),
dump: require('./output/dump'),
xlsx: require('./output/xlsx')
xlsx: require('./output/xlsx'),
sqlite: require('./output/sqlite')
};

// this collects options
Expand Down Expand Up @@ -181,6 +182,10 @@ if (config.get('output') === 'xlsx' && !config.get('file')) {
Cli.error(`Cannot output an xlsx to stdout. You probably forgot to use the --file parameter`);
}

if (config.get('output') === 'sqlite' && !config.get('file')) {
Cli.error(`Cannot output an sqlite to stdout. You probably forgot to use the --file parameter`);
}

// file prompt
new Promise(resolve => {
if (config.get('file') && fs.existsSync(config.get('file'))) {
Expand Down
Loading