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

Issue 336513002: version.py: Use argparse instead of getopt. (Closed)

Created:
6 years, 6 months ago by Raphael Kubo da Costa (rakuco)
Modified:
6 years, 6 months ago
Reviewers:
Mark Mentovai, brettw
CC:
chromium-reviews
Project:
chromium
Visibility:
Public.

Description

version.py: Use argparse instead of getopt. Rewrite the argument handling code using argparse. It allows us to get rid of a lot of manual parsing as well as the whole help message. In addition, it fixes a few other bugs present in the previous implementation: - Passing 3 or more arguments that are not values for parameters would cause an infinite loop. - The "--template" option was not allowed (only its short form "-t" was). R=mark@chromium.org, brettw@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277450

Patch Set 1 #

Total comments: 4

Patch Set 2 : Patch v2 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -74 lines) Patch
M build/util/version.py View 1 4 chunks +43 lines, -74 lines 2 comments Download

Messages

Total messages: 9 (0 generated)
Raphael Kubo da Costa (rakuco)
6 years, 6 months ago (2014-06-12 12:10:06 UTC) #1
Mark Mentovai
https://codereview.chromium.org/336513002/diff/1/build/util/version.py File build/util/version.py (right): https://codereview.chromium.org/336513002/diff/1/build/util/version.py#newcode10 build/util/version.py:10: import argparse The CL description still mentions optparse. https://codereview.chromium.org/336513002/diff/1/build/util/version.py#newcode104 ...
6 years, 6 months ago (2014-06-12 13:49:44 UTC) #2
Raphael Kubo da Costa (rakuco)
Sorry for the brain farts, I hadn't realized -e was accumulating before. Patch v2 should ...
6 years, 6 months ago (2014-06-16 13:21:16 UTC) #3
Mark Mentovai
LGTM https://codereview.chromium.org/336513002/diff/20001/build/util/version.py File build/util/version.py (right): https://codereview.chromium.org/336513002/diff/20001/build/util/version.py#newcode104 build/util/version.py:104: parser.add_argument('-f', '--file', action='append', default=[], I don’t know what ...
6 years, 6 months ago (2014-06-16 13:28:24 UTC) #4
Raphael Kubo da Costa (rakuco)
https://codereview.chromium.org/336513002/diff/20001/build/util/version.py File build/util/version.py (right): https://codereview.chromium.org/336513002/diff/20001/build/util/version.py#newcode104 build/util/version.py:104: parser.add_argument('-f', '--file', action='append', default=[], On 2014/06/16 13:28:23, Mark Mentovai ...
6 years, 6 months ago (2014-06-16 13:41:43 UTC) #5
Raphael Kubo da Costa (rakuco)
The CQ bit was checked by raphael.kubo.da.costa@intel.com
6 years, 6 months ago (2014-06-16 13:42:12 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raphael.kubo.da.costa@intel.com/336513002/20001
6 years, 6 months ago (2014-06-16 13:43:25 UTC) #7
Mark Mentovai
Aha, right. LGTM.
6 years, 6 months ago (2014-06-16 14:12:44 UTC) #8
commit-bot: I haz the power
6 years, 6 months ago (2014-06-16 15:41:44 UTC) #9
Message was sent while issue was closed.
Change committed as 277450

Powered by Google App Engine
This is Rietveld 408576698