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

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 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/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..38ab601b31555310203bcab85273ad46079c1145 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')
binji 2014/11/13 23:57:01 nargs='*'
Sam Clegg 2014/11/30 17:55:11 Done.
- 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

Powered by Google App Engine
This is Rietveld 408576698