Index: bin/stamps
===================================================================
--- bin/stamps	(revision 3)
+++ bin/stamps	(revision 10)
@@ -1,52 +1,22 @@
 #!/usr/bin/env python
 
-import sys
+import argparse
 from stamper import Stamper
-
-
-def usage(name):
-    msg = """
-    Usage:
-
-    To gather information of recorded times: %(name)s
-
-    Recorded times for a given customer: %(name)s customer
-
-    Detailed times for a given customer: %(name)s customer details
-    """ % {'name': name}
-    print(msg)
 
 
 if __name__ == '__main__':
 
+    parser = argparse.ArgumentParser(
+        description='stamps: show recorded times information')
+    parser.add_argument('customer', action="store", nargs='?',
+                        help='Show times only for this customer')
+    parser.add_argument('filter', action="store", nargs='?',
+                        help='Filter the times by date range')
+    parser.add_argument('-v', '--verbose', action="store_true",
+                        help='Include detailed times information')
+
+    args = parser.parse_args()
+
     s = Stamper()
     s.load_stamps()
-
-    if len(sys.argv) == 1:
-        totals = s.totals()
-        print('Total times for all customers:')
-        for t in totals:
-            print(' -> %(customer)s: %(total)s' % {'customer': t,
-                                                   'total': totals[t]})
-    elif len(sys.argv) == 2:
-        if sys.argv[1] in s.customers():
-            print('Total time for %(customer)s: %(total)s' % {
-                'customer': sys.argv[1],
-                'total': s.total_by_customer(sys.argv[1])
-                })
-
-    elif len(sys.argv) == 3:
-        if sys.argv[1] in s.customers():
-            print('Detailed time for %(customer)s' % {
-                'customer': sys.argv[1],
-                })
-            details, totals = s.details_by_customer(sys.argv[1])
-            for day in details:
-                print('------ %(day)s ------' % {'day': day})
-                for line in details[day]:
-                    print(line)
-                print(' Total: %(total)s' % {'total': totals[day]})
-
-    else:
-        usage(sys.argv[0])
-        sys.exit(1)
+    s.show_stamps(args.customer, args.filter, args.verbose)
Index: bin/time_sum
===================================================================
--- bin/time_sum	(revision 13)
+++ bin/time_sum	(revision 13)
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+import sys
+import time
+
+TIME_FORMAT= "%H:%M"
+HOURS_DAY = 8
+SECS_DAY = HOURS_DAY * 60 * 60
+
+def usage(name):
+    msg = """
+time_sum.py: Sum dates in proper hour time
+
+Params: Worked hours
+Syntax: $ ./time_sum 6:45 13:48 12:44 8:28 14:43
+56:28 min. = 7 days, remaining: 0:28 (8 hours/day)
+"""
+    print(msg)
+    exit(1)
+
+def isTimeFormat(input):
+    try:
+        time.strptime(input, TIME_FORMAT)
+        return True
+    except ValueError:
+        return False
+
+totalSecs = 0
+
+if __name__ == '__main__':
+
+    for param in sys.argv[1:]:
+        if not isTimeFormat(param):
+            print("Invalid hour format: %s" % param)
+            help()
+            exit(1)
+        timeParts = [int(s) for s in param.split(':')]
+        totalSecs += (timeParts[0] * 60 + timeParts[1]) * 60
+
+    totalDays, remaining = divmod(totalSecs, SECS_DAY)
+    remainingMin, remainingSec = divmod(remaining, (60))
+    remainingHr, remainingMin = divmod(remainingMin, (60))
+
+    totalSecs, sec = divmod(totalSecs, 60)
+    hr, min = divmod(totalSecs, 60)
+    print "%d:%02d hours. = %d days, remaining: %d:%02d (%d hours/day)" % (
+        hr, min, totalDays, remainingHr, remainingMin, HOURS_DAY)
