From 8f94316e33e5dd7e7fc8fa413d3bef6c178a3526 Mon Sep 17 00:00:00 2001 From: Dan White Date: Tue, 27 Jun 2023 15:39:14 -0500 Subject: [PATCH] TimeSampleHistogram: opt to ignore case --- TimeSampleHistogram | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TimeSampleHistogram b/TimeSampleHistogram index 999fbf4..ab69d80 100755 --- a/TimeSampleHistogram +++ b/TimeSampleHistogram @@ -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': -- 2.25.1