File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 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 = {
6363 return true ;
6464 }
6565} ;
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+ } ;
6679var path = require ( 'path' ) ,
6780 editorconfig = require ( 'editorconfig' ) ,
6881 knownOpts = {
@@ -112,7 +125,7 @@ var path = require('path'),
112125 // CLI
113126 "version" : Boolean ,
114127 "help" : Boolean ,
115- "files" : [ path , Array ] ,
128+ "files" : [ "glob" , Array ] ,
116129 "outfile" : path ,
117130 "replace" : Boolean ,
118131 "quiet" : Boolean ,
You can’t perform that action at this time.
0 commit comments