Skip to content

Commit 0833099

Browse files
committed
Add shorthands for gtt-start command. kriskbx#23
1 parent 7855f6b commit 0833099

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/gtt-start.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const Tasks = require('./include/tasks');
99
program
1010
.arguments('[project] [id]')
1111
.option('-t, --type <type>', 'specify resource type: issue, merge_request')
12+
.option('-m', 'shorthand for --type=merge_request')
13+
.option('-i', 'shorthand for --type=issue')
1214
.option('--verbose', 'show verbose output')
1315
.parse(process.argv);
1416

@@ -20,6 +22,12 @@ let config = new Config(process.cwd()),
2022
id = program.args.length === 1 ? parseInt(program.args[0]) : parseInt(program.args[1]),
2123
project = program.args.length === 2 ? program.args[0] : null;
2224

25+
if (program.I) {
26+
type = 'issue';
27+
} else if (program.M) {
28+
type = 'merge_request';
29+
}
30+
2331
if (program.args.length < 2 && !config.get('project'))
2432
Cli.error('No project set');
2533

0 commit comments

Comments
 (0)