source: stamper/stamper/cli.py

Last change on this file was 61:8fe64b5932b9, checked in by Borja Lopez <borja@…>, 9 years ago

Filter stamps by text in their description/action.

Examples:

  • Returns all stamps for customer A that contain the word "updated":

stamps -t -desc updated A

  • Returns the sum of times for the work on the release of a project for customer B (if you added RELEASE as a text on those stamps):

stamps -vs -desc RELEASE B

File size: 1.4 KB
Line 
1import argparse
2
3
4def build_args_parser():
5 parser = argparse.ArgumentParser(
6 description='stamps: show recorded times information')
7 parser.add_argument('customer', action="store", nargs='?',
8 help='Show times only for this customer')
9 parser.add_argument('filter', action="store", nargs='?',
10 help='Filter the times by date range')
11 parser.add_argument('-v', '--verbose', action="store_true",
12 help='Include detailed times information')
13 parser.add_argument('-s', '--sum', action="store_true",
14 help='Include sum of times')
15 parser.add_argument('-g', '--graph', action="store_true",
16 help='Generate a SVG graph')
17 parser.add_argument('-t', '--timeline', action="store_true",
18 help='Show a timeline of recorded times')
19 parser.add_argument('-desc', '--description', action="store",
20 help='Filter results by the description in the stamp')
21 parser.add_argument('-d', '--delete', action="store", type=int,
22 help='Delete up to n recorded stamps')
23 parser.add_argument('-i', '--import', action="store", dest="import_file",
24 help='Import stamps from the given file')
25 parser.add_argument('-p', '--push', action="store_true",
26 help='Push stamps to a remote stamps collector server')
27 return parser
Note: See TracBrowser for help on using the repository browser.