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 d90f214f8e4f78a56be1a78a345091e354cbb0f3..05c02c29de0c01902a4ff9637dc72fd762e73e4b 100755 |
--- a/native_client_sdk/src/doc/doxygen/doxy_cleanup.py |
+++ b/native_client_sdk/src/doc/doxygen/doxy_cleanup.py |
@@ -7,12 +7,13 @@ |
that they are suitable for publication on a Google documentation site. |
''' |
+import argparse |
import glob |
-import optparse |
import os |
import re |
import shutil |
import sys |
+ |
try: |
from BeautifulSoup import BeautifulSoup, Tag |
except (ImportError, NotImplementedError): |
@@ -147,24 +148,23 @@ class HTMLFixer(object): |
return html |
-def main(argv): |
+def main(args): |
"""Main entry for the doxy_cleanup utility |
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(description=__doc__) |
+ 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(args) |
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. |