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

Unified Diff: native_client_sdk/src/build_tools/update_sdktools.py

Issue 720233003: [NaCl SDK] Convert python scripts from optparse to argparse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: native_client_sdk/src/build_tools/update_sdktools.py
diff --git a/native_client_sdk/src/build_tools/update_sdktools.py b/native_client_sdk/src/build_tools/update_sdktools.py
index 561093f2e0dc2d64d8d2e51a615b0b0c88e21146..e9e72d14017a8378a62d29fea4e4ad804288c5e8 100755
--- a/native_client_sdk/src/build_tools/update_sdktools.py
+++ b/native_client_sdk/src/build_tools/update_sdktools.py
@@ -16,10 +16,10 @@ update_nacl_manifest.py is customarily run by a cron job, and does not check in
any changes. Instead it modifies the manifest file in cloud storage."""
+import argparse
import collections
import difflib
import json
-import optparse
import re
import sys
import urllib2
@@ -107,12 +107,10 @@ def UpdateManifestFileToRevision(filename, revision):
def main(args):
- parser = optparse.OptionParser(description=__doc__)
- parser.add_option('-r', '--revision',
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('-r', '--revision',
help='set revision manually, rather than using the latest version')
- options, args = parser.parse_args(args)
- if len(args) != 0:
- parser.error('Unexpected args: %s' % ', '.join(args))
+ options = parser.parse_args(args)
# TODO(binji): http://crbug.com/169047. Rename RealDelegate to something else.
delegate = RealDelegate()
« no previous file with comments | « native_client_sdk/src/build_tools/update_nacl_manifest.py ('k') | native_client_sdk/src/build_tools/verify_filelist.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698