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

Unified Diff: native_client_sdk/src/tools/getos.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 6 years, 1 month 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/tools/getos.py
diff --git a/native_client_sdk/src/tools/getos.py b/native_client_sdk/src/tools/getos.py
index 8416b56f07648389db79b9e3c40e7fe95891c454..72e0bb7d9448b4d330b0ccadccf74006e5266f7f 100755
--- a/native_client_sdk/src/tools/getos.py
+++ b/native_client_sdk/src/tools/getos.py
@@ -10,7 +10,7 @@ the location of Chrome. This is used, for example, to determine the correct
Toolchain to invoke.
"""
-import optparse
+import argparse
import os
import re
import subprocess
@@ -216,21 +216,21 @@ def CheckVersion(required_version):
def main(args):
- parser = optparse.OptionParser()
- parser.add_option('--arch', action='store_true',
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--arch', action='store_true',
help='Print architecture of current machine (x86_32, x86_64 or arm).')
- parser.add_option('--chrome', action='store_true',
+ parser.add_argument('--chrome', action='store_true',
help='Print the path chrome (by first looking in $CHROME_PATH and '
'then $PATH).')
- parser.add_option('--nacl-arch', action='store_true',
+ parser.add_argument('--nacl-arch', action='store_true',
help='Print architecture used by NaCl on the current machine.')
- parser.add_option('--sdk-version', action='store_true',
+ parser.add_argument('--sdk-version', action='store_true',
help='Print major version of the NaCl SDK.')
- parser.add_option('--sdk-revision', action='store_true',
+ parser.add_argument('--sdk-revision', action='store_true',
help='Print revision number of the NaCl SDK.')
- parser.add_option('--sdk-commit-position', action='store_true',
+ parser.add_argument('--sdk-commit-position', action='store_true',
help='Print commit position of the NaCl SDK.')
- parser.add_option('--check-version',
+ parser.add_argument('--check-version',
metavar='MAJOR.POSITION',
help='Check that the SDK version is at least as great as the '
'version passed in. MAJOR is the major version number and POSITION '

Powered by Google App Engine
This is Rietveld 408576698