TimeSampleHistogram: opt to ignore case
authorDan White <dan@whiteaudio.com>
Tue, 27 Jun 2023 20:39:14 +0000 (15:39 -0500)
committerDan White <dan@whiteaudio.com>
Tue, 27 Jun 2023 20:39:14 +0000 (15:39 -0500)
TimeSampleHistogram

index 999fbf426892ae1d771199762b245002f3109e10..ab69d800e1ad098f731ac41dbb2f96e305572efa 100755 (executable)
@@ -56,6 +56,8 @@ parser.add_option('-W', '--isoweek', dest='isoweek',
                   help='only show ISO [YYYY-]WK', default=None)
 parser.add_option('-f', '--field-sep', dest='sep', type='str',
                   help='field separator', metavar='f', default='')
+parser.add_option('-i', '--ignore-case', dest='ignore_case', action='store_true',
+                  help='Convert everything to lower case first', default=False)
 (opt, args) = parser.parse_args()
 
 # default match is everything if not specified
@@ -191,6 +193,9 @@ for file in files:
         d = dt.datetime(*ri)
         t = m.group('text')
 
+        if opt.ignore_case:
+            t = t.lower()
+
         if not (d >= startdate and d <= enddate):
             continue
         if t == 'null':