Commit 681cee21 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

changed args syntax to support multiple --alias args always with pairs

parent 3fd9d678
......@@ -188,7 +188,7 @@ def main (args=None):
parser.add_argument('--cgibin', default="~/cgi-bin", help='')
parser.add_argument('--index', default=None, help='default: index.cgi')
parser.add_argument('--makefile', default=None, help='location of the makefile to use, default ./makefile')
parser.add_argument('--alias', nargs="+", help='Add a folder to serve, syntax is [mountpoint path] ... ')
parser.add_argument('--alias', nargs="+", action="append", help='Add a folder to serve, syntax is [mountpoint path] ... ')
args = parser.parse_args(args)
tryports = args.notryports
......@@ -239,8 +239,9 @@ def main (args=None):
corehtdocs.putChild("cgi-bin", corecgibin)
if args.alias:
for i in range(0, len(args.alias), 2):
mnt, path = args.alias[i], args.alias[i+1]
for mnt, path in args.alias:
# for i in range(0, len(args.alias), 2):
# mnt, path = args.alias[i], args.alias[i+1]
path = os.path.abspath(os.path.expanduser(path))
print (u"Alias: {0} ==> {1}".format(mnt, path).encode("utf-8"))
root_resource.putChild(mnt, File(path))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment