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

Unified Diff: native_client_sdk/src/build_tools/verify_ppapi.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/verify_ppapi.py
diff --git a/native_client_sdk/src/build_tools/verify_ppapi.py b/native_client_sdk/src/build_tools/verify_ppapi.py
index 54cb8c0753870d576948c3b85e66faca757fa41b..f1c36c38dceda65c02f4e43eac51308b5e712d11 100755
--- a/native_client_sdk/src/build_tools/verify_ppapi.py
+++ b/native_client_sdk/src/build_tools/verify_ppapi.py
@@ -11,7 +11,7 @@ For example, if a user adds "ppapi/c/foo.h", we check that the interface has
been added to "native_client_sdk/src/libraries/ppapi/library.dsc".
"""
-import optparse
+import argparse
import os
import sys
@@ -167,15 +167,12 @@ def VerifyOrPrintError(dsc_filename, dsc_sources_and_headers, changed_filenames,
def main(args):
- usage = '%prog <file>...'
- description = __doc__
- parser = optparse.OptionParser(usage=usage, description=description)
- args = parser.parse_args(args)[1]
- if not args:
- parser.error('Expected a PPAPI header or source file.')
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('sources', nargs='+')
+ options = parser.parse_args(args)
retval = 0
- lib_files = PartitionFiles(args)
+ lib_files = PartitionFiles(options.sources)
directory_list = GetDirectoryList(PPAPI_DIR, relative_to=SRC_DIR)
for lib_name, filenames in lib_files.iteritems():
if not filenames:
« no previous file with comments | « native_client_sdk/src/build_tools/verify_filelist.py ('k') | native_client_sdk/src/doc/doxygen/doxy_cleanup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698