@@ -23,8 +23,8 @@ const rules = {
23
23
} ;
24
24
25
25
const configuration = {
26
- string : [ 'cwd' , 'from' , 'to' , 'extends' , 'parser-preset' ] ,
27
- boolean : [ 'edit' , ' help', 'version' , 'quiet' , 'color' ] ,
26
+ string : [ 'cwd' , 'from' , 'to' , 'edit' , ' extends', 'parser-preset' ] ,
27
+ boolean : [ 'help' , 'version' , 'quiet' , 'color' ] ,
28
28
alias : {
29
29
c : 'color' ,
30
30
d : 'cwd' ,
@@ -40,7 +40,8 @@ const configuration = {
40
40
description : {
41
41
color : 'toggle colored output' ,
42
42
cwd : 'directory to execute in' ,
43
- edit : 'read last commit message found in ./.git/COMMIT_EDITMSG' ,
43
+ edit :
44
+ 'read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG' ,
44
45
extends : 'array of shareable configurations to extend' ,
45
46
from : 'lower end of the commit range to lint; applies if edit=false' ,
46
47
to : 'upper end of the commit range to lint; applies if edit=false' ,
@@ -74,6 +75,8 @@ const cli = meow(
74
75
const load = ( seed , opts ) => core . load ( seed , opts ) ;
75
76
76
77
function main ( options ) {
78
+ normalizeOptions ( options ) ;
79
+
77
80
const raw = options . input ;
78
81
const flags = options . flags ;
79
82
const fromStdin = rules . fromStdin ( raw , flags ) ;
@@ -113,6 +116,17 @@ function main(options) {
113
116
) ;
114
117
}
115
118
119
+ function normalizeOptions ( options ) {
120
+ const flags = options . flags ;
121
+
122
+ // The `edit` flag is either a boolean or a string but we are only allowed
123
+ // to specify one of them in minimist
124
+ if ( flags . edit === '' ) {
125
+ flags . edit = true ;
126
+ flags . e = true ;
127
+ }
128
+ }
129
+
116
130
function getSeed ( seed ) {
117
131
const e = Array . isArray ( seed . extends ) ? seed . extends : [ seed . extends ] ;
118
132
const n = e . filter ( i => typeof i === 'string' ) ;
0 commit comments