Commits

Katsunori FUJIWARA committed 2ce05c2

add "-l" option to filestat.py

Comments (0)

Files changed (1)

                          help="omit finished files",
                          action="store_const", const=1, dest="omit_finished"
                          ),
+    optparse.make_option("-l", '--list-filename',
+                         help="show only filenames",
+                         action="store_const", const=1, dest="list_filenames"
+                         ),
 ]
 
 optparser = optparse.OptionParser(usage='USAGE: %prog [options]',
         infostock = ['', '', False, {}]
         state = undefined_state
 
-print ' %-38s msgid done(rest) fuzzy' % ('filename:')
+if not options.list_filenames:
+    print ' %-38s msgid done(rest) fuzzy' % ('filename:')
 for filename, stat in sorted(files.items()):
     if options.omit_finished and (0 == (stat[0] - stat[1])) and (0 == stat[2]):
         continue
-    print ('%-40s % 4d % 4d(% 4d) % 4d' %
-           (filename, stat[0], stat[1], stat[0] - stat[1], stat[2]))
+    if options.list_filenames:
+        print ('%s' % (filename))
+    else:
+        print ('%-40s % 4d % 4d(% 4d) % 4d' %
+               (filename, stat[0], stat[1], stat[0] - stat[1], stat[2]))