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

Unified Diff: native_client_sdk/src/tools/httpd.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/tools/httpd.py
diff --git a/native_client_sdk/src/tools/httpd.py b/native_client_sdk/src/tools/httpd.py
index 4fcb89a685c5bc59c923808fe613f97427b9d319..258e5296b1f212d348ff72411ce10e6123f16d9a 100755
--- a/native_client_sdk/src/tools/httpd.py
+++ b/native_client_sdk/src/tools/httpd.py
@@ -6,7 +6,7 @@
import BaseHTTPServer
import logging
import multiprocessing
-import optparse
+import argparse
binji 2014/11/13 23:57:04 sort
Sam Clegg 2014/11/30 17:55:13 Done.
import os
import SimpleHTTPServer # pylint: disable=W0611
import socket
@@ -185,13 +185,13 @@ def _HTTPServerProcess(conn, dirname, port, server_kwargs):
def main(args):
- parser = optparse.OptionParser()
- parser.add_option('-C', '--serve-dir',
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-C', '--serve-dir',
help='Serve files out of this directory.',
default=os.path.abspath('.'))
- parser.add_option('-p', '--port',
+ parser.add_argument('-p', '--port',
help='Run server on this port.', default=5103)
- parser.add_option('--no-dir-check', '--no_dir_check',
+ parser.add_argument('--no-dir-check', '--no_dir_check',
help='No check to ensure serving from safe directory.',
dest='do_safe_check', action='store_false', default=True)

Powered by Google App Engine
This is Rietveld 408576698