Mercurial > mozilla > hg > MozillaHg
comparison mozillahg/main.py @ 0:1855ba0b873a
initial commit
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 22 Jan 2013 21:30:20 -0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1855ba0b873a |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 """ | |
4 mozilla interface to mercurial | |
5 """ | |
6 | |
7 import sys | |
8 import optparse | |
9 | |
10 def main(args=sys.argv[:]): | |
11 | |
12 # parse command line options | |
13 usage = '%prog [options]' | |
14 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): | |
15 """description formatter for console script entry point""" | |
16 def format_description(self, description): | |
17 if description: | |
18 return description.strip() + '\n' | |
19 else: | |
20 return '' | |
21 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) | |
22 options, args = parser.parse_args(args) | |
23 | |
24 if __name__ == '__main__': | |
25 main() | |
26 |