@@ -12,7 +12,7 @@ const pkg = require('../package');
12
12
const help = require ( './help' ) ;
13
13
14
14
const configuration = {
15
- string : [ 'cwd' , 'from' , 'to' , 'edit' , 'extends' , 'parser-preset' ] ,
15
+ string : [ 'cwd' , 'from' , 'to' , 'edit' , 'extends' , 'parser-preset' , 'config' ] ,
16
16
boolean : [ 'help' , 'version' , 'quiet' , 'color' ] ,
17
17
alias : {
18
18
c : 'color' ,
@@ -22,13 +22,15 @@ const configuration = {
22
22
t : 'to' ,
23
23
q : 'quiet' ,
24
24
h : 'help' ,
25
+ g : 'config' ,
25
26
v : 'version' ,
26
27
x : 'extends' ,
27
28
p : 'parser-preset'
28
29
} ,
29
30
description : {
30
31
color : 'toggle colored output' ,
31
32
cwd : 'directory to execute in' ,
33
+ config : 'path to the config file' ,
32
34
edit :
33
35
'read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG' ,
34
36
extends : 'array of shareable configurations to extend' ,
@@ -41,6 +43,7 @@ const configuration = {
41
43
default : {
42
44
color : true ,
43
45
cwd : process . cwd ( ) ,
46
+ config : null ,
44
47
edit : false ,
45
48
from : null ,
46
49
to : null ,
@@ -96,7 +99,8 @@ async function main(options) {
96
99
throw err ;
97
100
}
98
101
99
- const loaded = await core . load ( getSeed ( flags ) , { cwd : flags . cwd } ) ;
102
+ const loadOpts = { cwd : flags . cwd , file : flags . config } ;
103
+ const loaded = await core . load ( getSeed ( flags ) , loadOpts ) ;
100
104
const parserOpts = selectParserOpts ( loaded . parserPreset ) ;
101
105
const opts = parserOpts ? { parserOpts} : { parserOpts : { } } ;
102
106
0 commit comments