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

Unified Diff: native_client_sdk/src/doc/doxygen/doxy_cleanup.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/doc/doxygen/doxy_cleanup.py
diff --git a/native_client_sdk/src/doc/doxygen/doxy_cleanup.py b/native_client_sdk/src/doc/doxygen/doxy_cleanup.py
index 491fd047109cd921e33a57fdc24882a13cdd16fe..d47afb8bc686af7b2692a28992e5f3e1353337f7 100755
--- a/native_client_sdk/src/doc/doxygen/doxy_cleanup.py
+++ b/native_client_sdk/src/doc/doxygen/doxy_cleanup.py
@@ -9,7 +9,7 @@ that they are suitable for publication on a Google documentation site.
'''
import glob
-import optparse
+import argparse
binji 2014/11/13 23:57:02 sort
Sam Clegg 2014/11/30 17:55:12 Done.
import os
import re
import shutil
@@ -154,18 +154,17 @@ def main(argv):
doxy_cleanup cleans up the html files generated by doxygen.
"""
- parser = optparse.OptionParser(usage='Usage: %prog [options] directory')
- parser.add_option('-v', '--verbose', help='verbose output.',
- action='store_true')
- options, files = parser.parse_args(argv)
+ parser = argparse.ArgumentParser(usage='Usage: %prog [options] directory')
binji 2014/11/13 23:57:02 remove usage?
Sam Clegg 2014/11/30 17:55:12 Done.
+ parser.add_argument('-v', '--verbose', help='verbose output.',
+ action='store_true')
+ parser.add_argument('directory')
- if len(files) != 1:
- parser.error('Expected one directory')
+ options = parser.parse_args(argv)
if options.verbose:
Trace.verbose = True
- root_dir = files[0]
+ root_dir = options.directory
html_dir = os.path.join(root_dir, 'html')
# Doxygen puts all files in an 'html' directory.

Powered by Google App Engine
This is Rietveld 408576698