From eab57aec2834afde79809f3cc422e00260089657 Mon Sep 17 00:00:00 2001 From: Jonathan Patrick Davies Date: Mon, 11 Aug 2008 23:45:07 +0100 Subject: [PATCH] * get-branches: Now check team option before anything else. --- debian/changelog | 1 + get-branches | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index f8d0bb4..5f3afd5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ ubuntu-dev-tools (0.37ubuntu1) intrepid; urgency=low * requestsync: Use the functions in the common.py file above to authenticate with Launchpad. * debian/control: Changed XS-Python-Version to >= 2.5. + * get-branches: Now check team option before anything else. [ Siegfried-Angel Gevatter Pujals ] * Add the GNU General Public License header to all scripts. diff --git a/get-branches b/get-branches index 2cb248f..caccf23 100755 --- a/get-branches +++ b/get-branches @@ -48,6 +48,15 @@ def main(): (options, args) = optParser.parse_args() # Parse our options. + # No flags, and no team name specified. + if not options.lpteam and not args: + print >> sys.stderr, "No team has been specified." + optParser.print_help() + sys.exit(1) + + if args: + team = args[0] + # Dictionary settings. if options.directory: try: @@ -71,7 +80,7 @@ def main(): # Launchpad team setting. if options.lpteam: try: - team = args[0] + team = args[optsParsed] optsParsed += 1 except IndexError: print >> sys.stderr, "The '-t' option requires an argument." @@ -97,14 +106,6 @@ def main(): else: operation_type = "branch" - # No flags, and no team name specified. - if not options.lpteam and not args: - print >> sys.stderr, "No team has been specified." - optParser.print_help() - sys.exit(1) - elif args: - team = args[optsParsed] - pwd = os.getcwd() os.chdir(directory)