Commit 647798cd authored by maruel@chromium.org's avatar maruel@chromium.org

Add --help support to git-tree-prune.

Full support to tools in git-utils will be added soon

TBR=groby@chromium.org
BUG=
TEST=


Review URL: https://chromiumcodereview.appspot.com/10445021

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@138825 0039d316-1c4b-4281-b951-d872f2087c98
parent 66bc1a51
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
"""A tool for listing branches with closed and abandoned issues.""" """Lists branches with closed and abandoned issues."""
import optparse
import os import os
import sys import sys
import urllib2 import urllib2
...@@ -25,11 +26,11 @@ class Branch(git_cl.Changelist): ...@@ -25,11 +26,11 @@ class Branch(git_cl.Changelist):
def __init__(self, name): def __init__(self, name):
git_cl.Changelist.__init__(self, branchref=name) git_cl.Changelist.__init__(self, branchref=name)
self._issue_status = None self._issue_status = None
def GetStatus(self): def GetStatus(self):
if not self._issue_status: if not self._issue_status:
if self.GetIssue(): if self.GetIssue():
try: try:
issue_properties = self.RpcServer().get_issue_properties( issue_properties = self.RpcServer().get_issue_properties(
self.GetIssue(), None) self.GetIssue(), None)
if issue_properties['closed']: if issue_properties['closed']:
...@@ -44,7 +45,12 @@ class Branch(git_cl.Changelist): ...@@ -44,7 +45,12 @@ class Branch(git_cl.Changelist):
return self._issue_status return self._issue_status
def main(argv): def main():
parser = optparse.OptionParser(usage=sys.modules['__main__'].__doc__)
options, args = parser.parse_args()
if args:
parser.error('Unsupported arg: %s' % args)
branches = get_branches() branches = get_branches()
filtered = { 'closed' : [], filtered = { 'closed' : [],
'pending' : [], 'pending' : [],
...@@ -76,4 +82,4 @@ def main(argv): ...@@ -76,4 +82,4 @@ def main(argv):
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main(sys.argv[1:])) sys.exit(main())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment