Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: git-utils/git-tree-prune

Issue 10445021: Add --help support to git-tree-prune. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git-utils/git-tree-prune
diff --git a/git-utils/git-tree-prune b/git-utils/git-tree-prune
index cf01a311b154ab6210d6c966f5f2ce0a3a11574b..8ff047db069421cca09033ea4a19c2e8dde0c49b 100755
--- a/git-utils/git-tree-prune
+++ b/git-utils/git-tree-prune
@@ -3,8 +3,9 @@
# Use of this source code is governed by a BSD-style license that can be
# 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 sys
import urllib2
@@ -25,11 +26,11 @@ class Branch(git_cl.Changelist):
def __init__(self, name):
git_cl.Changelist.__init__(self, branchref=name)
self._issue_status = None
-
+
def GetStatus(self):
if not self._issue_status:
if self.GetIssue():
- try:
+ try:
issue_properties = self.RpcServer().get_issue_properties(
self.GetIssue(), None)
if issue_properties['closed']:
@@ -44,7 +45,12 @@ class Branch(git_cl.Changelist):
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()
filtered = { 'closed' : [],
'pending' : [],
@@ -76,4 +82,4 @@ def main(argv):
if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
+ sys.exit(main())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698