Commit c62ca780 authored by Laurent Bachelier's avatar Laurent Bachelier

Use argparse in ass2m-serve

parent 17a278c1
......@@ -21,12 +21,11 @@
from ass2m.server import Server
import argparse
if __name__ == '__main__':
import sys
if len(sys.argv) > 1:
server = Server(sys.argv[1])
server.bind('0.0.0.0', 8042)
else:
print 'Usage: %s <rootdir>' % sys.argv[0]
sys.exit(1)
parser = argparse.ArgumentParser()
parser.add_argument('rootdir', help='root directory')
args = parser.parse_args()
server = Server(args.rootdir)
server.bind('0.0.0.0', 8042)
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