@@ -12,7 +12,7 @@ const pkg = require('../package');
1212const help = require ( './help' ) ;
1313
1414const configuration = {
15- string : [ 'cwd' , 'from' , 'to' , 'edit' , 'extends' , 'parser-preset' ] ,
15+ string : [ 'cwd' , 'from' , 'to' , 'edit' , 'extends' , 'parser-preset' , 'config' ] ,
1616 boolean : [ 'help' , 'version' , 'quiet' , 'color' ] ,
1717 alias : {
1818 c : 'color' ,
@@ -22,13 +22,15 @@ const configuration = {
2222 t : 'to' ,
2323 q : 'quiet' ,
2424 h : 'help' ,
25+ g : 'config' ,
2526 v : 'version' ,
2627 x : 'extends' ,
2728 p : 'parser-preset'
2829 } ,
2930 description : {
3031 color : 'toggle colored output' ,
3132 cwd : 'directory to execute in' ,
33+ config : 'path to the config file' ,
3234 edit :
3335 'read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG' ,
3436 extends : 'array of shareable configurations to extend' ,
@@ -41,6 +43,7 @@ const configuration = {
4143 default : {
4244 color : true ,
4345 cwd : process . cwd ( ) ,
46+ config : null ,
4447 edit : false ,
4548 from : null ,
4649 to : null ,
@@ -96,7 +99,8 @@ async function main(options) {
9699 throw err ;
97100 }
98101
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 ) ;
100104 const parserOpts = selectParserOpts ( loaded . parserPreset ) ;
101105 const opts = parserOpts ? { parserOpts} : { parserOpts : { } } ;
102106
0 commit comments