@@ -38,9 +38,13 @@ def splitCamelCase(word):
3838
3939def getMimeType (filepath ):
4040
41- suffix2mime = {'.h' : 'text/x-c++' , '.py' : 'text/x-python' ,
42- '.ruby' : 'test/x-ruby' ,
43- '.java' : 'text/x-java-source' }
41+ suffix2mime = { '.h' : 'text/x-c++' ,
42+ '.cxx' : 'text/x-c++' ,
43+ '.c' : 'text/x-c++' ,
44+ '.py' : 'text/x-python' ,
45+ '.ruby' : 'test/x-ruby' ,
46+ '.java' : 'text/x-java-source'
47+ }
4448 name , ext = os .path .splitext (filepath )
4549 return suffix2mime [ext ]
4650
@@ -174,7 +178,7 @@ def parse_args():
174178 parser .add_argument ('--miss' , '-m' , action = 'store_true' , default = False ,
175179 dest = 'miss' , help = 'Only output the misspelt words' )
176180
177- parser .add_argument ('--suffix' , '-s' , action = 'store ' , default = ".h" ,
181+ parser .add_argument ('--suffix' , '-s' , action = 'append ' , default = [ ".h" ] ,
178182 dest = 'suffix' , help = 'File name suffix' )
179183
180184 args = parser .parse_args ()
@@ -228,6 +232,10 @@ def main():
228232
229233 bad_words = []
230234
235+ if output_lvl > 1 :
236+ print ("Prefixes:" , prefixes )
237+ print ("Suffixes:" , args .suffix )
238+
231239 for f in file_list :
232240
233241 if not args .miss :
@@ -236,7 +244,12 @@ def main():
236244 if os .path .isdir (f ):
237245
238246 # f is a directory, so search for files inside
239- dir_entries = glob .glob (f + '/**/*' + args .suffix , recursive = True )
247+ dir_entries = []
248+ for s in args .suffix :
249+ dir_entries = dir_entries + glob .glob (f + '/**/*' + s , recursive = True )
250+
251+ if output_lvl :
252+ print (dir_entries )
240253
241254 # spell check the files found in f
242255 for x in dir_entries :
0 commit comments