source: stamper/bin/stamps@ 18:f8c2304728ba

Last change on this file since 18:f8c2304728ba was 10:d3a34cb9b65f, checked in by Borja Lopez <borja@…>, 10 years ago

Use argparse to parse the arguments to the stamps script.
Moved all the logic to display stamps information to the main
stamper module.

  • Property exe set to *
File size: 713 bytes
Line 
1#!/usr/bin/env python
2
3import argparse
4from stamper import Stamper
5
6
7if __name__ == '__main__':
8
9 parser = argparse.ArgumentParser(
10 description='stamps: show recorded times information')
11 parser.add_argument('customer', action="store", nargs='?',
12 help='Show times only for this customer')
13 parser.add_argument('filter', action="store", nargs='?',
14 help='Filter the times by date range')
15 parser.add_argument('-v', '--verbose', action="store_true",
16 help='Include detailed times information')
17
18 args = parser.parse_args()
19
20 s = Stamper()
21 s.load_stamps()
22 s.show_stamps(args.customer, args.filter, args.verbose)
Note: See TracBrowser for help on using the repository browser.