File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,19 @@ nopt.typeDefs.brace_style = {
63
63
return true ;
64
64
}
65
65
} ;
66
+ nopt . typeDefs . glob = {
67
+ type : "glob" ,
68
+ validate : function ( data , key , val ) {
69
+ if ( typeof val === 'string' && glob . hasMagic ( val ) ) {
70
+ // Preserve value if it contains glob magic
71
+ data [ key ] = val ;
72
+ return true ;
73
+ } else {
74
+ // Otherwise validate it as regular path
75
+ return nopt . typeDefs . path . validate ( data , key , val ) ;
76
+ }
77
+ }
78
+ } ;
66
79
var path = require ( 'path' ) ,
67
80
editorconfig = require ( 'editorconfig' ) ,
68
81
knownOpts = {
@@ -112,7 +125,7 @@ var path = require('path'),
112
125
// CLI
113
126
"version" : Boolean ,
114
127
"help" : Boolean ,
115
- "files" : [ path , Array ] ,
128
+ "files" : [ "glob" , Array ] ,
116
129
"outfile" : path ,
117
130
"replace" : Boolean ,
118
131
"quiet" : Boolean ,
You can’t perform that action at this time.
0 commit comments