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)
