Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit a8fd623

Browse files
author
Andreas Müller
committed
minimal log for integration in shell prompt
1 parent 5e54810 commit a8fd623

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/gtt-status.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const Tasks = require('./include/tasks');
88

99
program
1010
.option('--verbose', 'show verbose output')
11+
.option('-s', 'short output')
1112
.parse(process.argv);
1213

1314
Cli.verbose = program.opts().verbose;
@@ -18,10 +19,17 @@ let config = new Config(__dirname),
1819
tasks.status()
1920
.then(frames => {
2021
if (frames.length === 0) {
21-
console.log('No projects are started right now.');
22+
if (program.opts().s) {
23+
console.log('gtt idle ');
24+
}else {
25+
console.log('No projects are started right now.');
26+
}
2227
return;
2328
}
24-
25-
frames.forEach(frame => console.log(`Project ${frame.project.magenta} ${frame.resource.type.blue} ${('#' + frame.resource.id).blue} ${frame.note?frame.note:''} is running, started ${moment(frame.start).fromNow().green} (id: ${frame.id})`));
29+
if (program.opts().s) {
30+
frames.forEach(frame => console.log(`${frame.project.magenta} ${frame.resource.type.blue} ${('#' + frame.resource.id).blue} ${moment(frame.start).fromNow().green} (id: ${frame.id})`));
31+
} else {
32+
frames.forEach(frame => console.log(`Project ${frame.project.magenta} ${frame.resource.type.blue} ${('#' + frame.resource.id).blue} ${frame.note?frame.note:''} is running, started ${moment(frame.start).fromNow().green} (id: ${frame.id})`));
33+
}
2634
})
2735
.catch(error => Cli.error('Could not read frames.', error));

0 commit comments

Comments
 (0)