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

Unified Diff: tools/push-to-trunk/auto_roll.py

Issue 181583002: Refactoring: Deprecate optparse in push and merge scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | tools/push-to-trunk/merge_to_branch.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/auto_roll.py
diff --git a/tools/push-to-trunk/auto_roll.py b/tools/push-to-trunk/auto_roll.py
index fc50afb32f00ac6de4ee1ef763837601e7b88804..2c71041d0295ac6191fdc5cb6485c9eb5bbc159f 100755
--- a/tools/push-to-trunk/auto_roll.py
+++ b/tools/push-to-trunk/auto_roll.py
@@ -26,8 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import argparse
import json
-import optparse
import os
import re
import sys
@@ -180,28 +180,28 @@ def RunAutoRoll(config,
def BuildOptions():
- result = optparse.OptionParser()
- result.add_option("-a", "--author", dest="a",
- help=("Specify the author email used for rietveld."))
- result.add_option("-c", "--chromium", dest="c",
- help=("Specify the path to your Chromium src/ "
- "directory to automate the V8 roll."))
- result.add_option("-p", "--push",
- help="Push to trunk if possible. Dry run if unspecified.",
- default=False, action="store_true")
- result.add_option("-r", "--reviewer",
- help=("Specify the account name to be used for reviews."))
- result.add_option("-s", "--step", dest="s",
- help="Specify the step where to start work. Default: 0.",
- default=0, type="int")
- result.add_option("--status-password",
- help="A file with the password to the status app.")
- return result
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-a", "--author", dest="a",
+ help="The author email used for rietveld.")
+ parser.add_argument("-c", "--chromium", dest="c",
+ help=("The path to your Chromium src/ directory to "
+ "automate the V8 roll."))
+ parser.add_argument("-p", "--push",
+ help="Push to trunk if possible. Dry run if unspecified.",
+ default=False, action="store_true")
+ parser.add_argument("-r", "--reviewer",
+ help="The account name to be used for reviews.")
+ parser.add_argument("-s", "--step", dest="s",
+ help="Specify the step where to start work. Default: 0.",
+ default=0, type=int)
+ parser.add_argument("--status-password",
+ help="A file with the password to the status app.")
+ return parser
def Main():
parser = BuildOptions()
- (options, args) = parser.parse_args()
+ options = parser.parse_args()
if not options.a or not options.c or not options.reviewer:
print "You need to specify author, chromium src location and reviewer."
parser.print_help()
« no previous file with comments | « no previous file | tools/push-to-trunk/merge_to_branch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698