Use current username as default

Instead of russelb.  I mean, it's the user's fault they aren't
russelb, but I think this change follows the robustness principle.

Change-Id: I5a5b09836840220540980e6d0eb0e4d324dc2678
This commit is contained in:
James E. Blair 2013-07-29 13:34:27 -07:00
parent ac7bc3d4e2
commit 5dcb4a9703
3 changed files with 6 additions and 3 deletions

View File

@ -22,6 +22,7 @@ Prints out list of approved patches that failed to merge and are currently
still open. Only show patches that are likely to be trivial rebases. still open. Only show patches that are likely to be trivial rebases.
""" """
import getpass
import optparse import optparse
import sys import sys
@ -37,7 +38,7 @@ def main(argv=None):
help='JSON file describing the project to generate stats for') help='JSON file describing the project to generate stats for')
optparser.add_option('-a', '--all', action='store_true', optparser.add_option('-a', '--all', action='store_true',
help='Generate stats across all known projects (*.json)') help='Generate stats across all known projects (*.json)')
optparser.add_option('-u', '--user', default='russellb', help='gerrit user') optparser.add_option('-u', '--user', default=getpass.getuser(), help='gerrit user')
optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit') optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit')
optparser.add_option('-s', '--stable', action='store_true', optparser.add_option('-s', '--stable', action='store_true',
help='Include stable branch commits') help='Include stable branch commits')

View File

@ -18,6 +18,7 @@
import calendar import calendar
import datetime import datetime
import getpass
import optparse import optparse
import os import os
import os.path import os.path
@ -234,7 +235,7 @@ def main(argv=None):
help='JSON file describing the project to generate stats for') help='JSON file describing the project to generate stats for')
optparser.add_option('-a', '--all', action='store_true', optparser.add_option('-a', '--all', action='store_true',
help='Generate stats across all known projects (*.json)') help='Generate stats across all known projects (*.json)')
optparser.add_option('-u', '--user', default='russellb', help='gerrit user') optparser.add_option('-u', '--user', default=getpass.getuser(), help='gerrit user')
optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit') optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit')
optparser.add_option('-s', '--stable', action='store_true', optparser.add_option('-s', '--stable', action='store_true',
help='Include stable branch commits') help='Include stable branch commits')

View File

@ -19,6 +19,7 @@
import calendar import calendar
import datetime import datetime
import getpass
import glob import glob
import json import json
import optparse import optparse
@ -38,7 +39,7 @@ optparser.add_option('-a', '--all', action='store_true',
help='Generate stats across all known projects (*.json)') help='Generate stats across all known projects (*.json)')
optparser.add_option('-d', '--days', type='int', default=14, optparser.add_option('-d', '--days', type='int', default=14,
help='Number of days to consider') help='Number of days to consider')
optparser.add_option('-u', '--user', default='russellb', help='gerrit user') optparser.add_option('-u', '--user', default=getpass.getuser(), help='gerrit user')
optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit') optparser.add_option('-k', '--key', default=None, help='ssh key for gerrit')
options, args = optparser.parse_args() options, args = optparser.parse_args()