Commits

Jason R. Coombs  committed 5366667

Added support for port selection in serve-local

  • Participants
  • Parent commits 34fd9e7
  • Tags 1.7b2

Comments (0)

Files changed (1)

File jaraco/net/http/static.py

+import os
+import argparse
+
 import cherrypy
-import os
 
 from . import staticdirindex
 from . import htmldir
 
+def get_args():
+	parser = argparse.ArgumentParser()
+	parser.add_argument('-p', '--port', default=80)
+	return parser.parse_args()
+
 def serve_local():
 	"""
 	Serve the current directory as static files.
 	"""
+	args = get_args()
 	config = {
 		'global': {
 			'server.socket_host': '::0',
+			'server.socket_port': args.port,
 		},
 		'/': {
 			'tools.staticdir.on': 'true',