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

Unified Diff: native_client_sdk/src/doc/doxygen/generate_docs.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
« no previous file with comments | « native_client_sdk/src/doc/doxygen/doxy_cleanup.py ('k') | native_client_sdk/src/doc/doxygen/rst_index.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/doc/doxygen/generate_docs.py
diff --git a/native_client_sdk/src/doc/doxygen/generate_docs.py b/native_client_sdk/src/doc/doxygen/generate_docs.py
index 0e6c545a7f07661df8bfafa39d6936fc89e9d647..13316efb03a10f8a14f930658b384b6f7ca8cb16 100755
--- a/native_client_sdk/src/doc/doxygen/generate_docs.py
+++ b/native_client_sdk/src/doc/doxygen/generate_docs.py
@@ -3,9 +3,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+"""Script to regenerate API docs using doxygen.
+"""
+
+import argparse
import collections
import json
-import optparse
import os
import shutil
import subprocess
@@ -227,7 +230,7 @@ def RunRstIndex(kind, channel, pepper_version, out_dirname, out_rst_filename):
'--channel', channel,
'--version', pepper_version,
out_dirname,
- '-o', out_rst_filename]
+ out_rst_filename]
Trace('Running rst_index:\n %s' % ' '.join(cmd))
subprocess.check_call(cmd)
@@ -288,20 +291,18 @@ def GenerateDocs(root_dirname, channel, pepper_version, branch):
def main(argv):
- parser = optparse.OptionParser(usage='Usage: %prog [options] <out_directory>')
- parser.add_option('-v', '--verbose',
- help='Verbose output', action='store_true')
- options, dirs = parser.parse_args(argv)
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('-v', '--verbose',
+ help='Verbose output', action='store_true')
+ parser.add_argument('out_directory')
+ options = parser.parse_args(argv)
if options.verbose:
Trace.verbose = True
- if len(dirs) != 1:
- parser.error('Expected an output directory')
-
channel_info = GetChannelInfo()
for channel, info in channel_info.iteritems():
- GenerateDocs(dirs[0], channel, info.version, info.branch)
+ GenerateDocs(options.out_directory, channel, info.version, info.branch)
return 0
« no previous file with comments | « native_client_sdk/src/doc/doxygen/doxy_cleanup.py ('k') | native_client_sdk/src/doc/doxygen/rst_index.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698