Mercurial > treepkg
comparison bin/treepkginfo.py @ 399:04310ad0063e treepkg-status
let the user specify num revisions that should be shown in the info
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Mon, 12 Jul 2010 12:10:34 +0000 |
parents | e2afbd3c2bf1 |
children | 94a6ae627b31 |
comparison
equal
deleted
inserted
replaced
398:09b7b7bf0b04 | 399:04310ad0063e |
---|---|
14 | 14 |
15 from treepkg.options import create_parser | 15 from treepkg.options import create_parser |
16 | 16 |
17 def parse_commandline(): | 17 def parse_commandline(): |
18 parser = create_parser() | 18 parser = create_parser() |
19 parser.set_defaults(newest=-1) | |
20 parser.add_option("--newest", type="int", | |
21 help=("Number of newest revisions to list.")) | |
22 parser.add_option("--pretty", action="store_true", help=("Show XML pretty" | |
23 " output.")) | |
19 | 24 |
25 | |
20 return parser.parse_args() | 26 return parser.parse_args() |
21 | 27 |
22 def main(): | 28 def main(): |
23 options, args = parse_commandline() | 29 options, args = parse_commandline() |
24 | 30 |
25 tpkginfo = status.TreepkgInfo(options.config_file) | 31 tpkginfo = status.TreepkgInfo(options.config_file, options.newest) |
32 | |
33 if options.pretty: | |
34 print tpkginfo.toxml().toprettyxml() | |
35 else: | |
36 print tpkginfo.toxml().toxml() | |
26 | 37 |
27 main() | 38 main() |