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

Unified Diff: native_client_sdk/src/build_tools/generate_notice.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/generate_notice.py
diff --git a/native_client_sdk/src/build_tools/generate_notice.py b/native_client_sdk/src/build_tools/generate_notice.py
index c7d81d245aba13f9908cdb61fb92d71cc884a040..ab873f74412465f00c0b541c734b652b79a031db 100755
--- a/native_client_sdk/src/build_tools/generate_notice.py
+++ b/native_client_sdk/src/build_tools/generate_notice.py
@@ -6,7 +6,7 @@
"""Build the NOTICE file distributed with the NaCl SDK from a set of given
license files."""
-import optparse
+import argparse
import os
import sys
@@ -68,13 +68,14 @@ def Generate(output_filename, root, files):
def main(args):
- parser = optparse.OptionParser()
- parser.add_option('-v', '--verbose', help='Verbose output.',
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('-v', '--verbose', help='Verbose output.',
action='store_true')
- parser.add_option('-o', '--output', help='Output file')
- parser.add_option('--root', help='Root for all paths')
+ parser.add_argument('-o', '--output', help='Output file')
+ parser.add_argument('--root', help='Root for all paths')
+ parser.add_argument('files', nargs='*')
- options, args = parser.parse_args(args)
+ options = parser.parse_args(args)
Trace.verbose = options.verbose
if not options.output:
@@ -82,7 +83,7 @@ def main(args):
if not options.root:
parser.error('No root directory given. See --root.')
- Generate(options.output, options.root, args)
+ Generate(options.output, options.root, options.files)
Trace('Done.')
return 0
« no previous file with comments | « native_client_sdk/src/build_tools/easy_template.py ('k') | native_client_sdk/src/build_tools/nacl-mono-archive.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698