From 0419c055322edc009c80e7bc3b33362d67b5ec50 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 17 Feb 2015 02:56:06 +0100
Subject: [PATCH] Server/py: Add command line parser for replay option.

---
 plomrogue-server.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/plomrogue-server.py b/plomrogue-server.py
index bcd985d..1e4eda1 100755
--- a/plomrogue-server.py
+++ b/plomrogue-server.py
@@ -1,3 +1,4 @@
+import argparse
 import errno
 import os
 import time
@@ -57,6 +58,11 @@ def detect_atomic_leftover(path):
 
 io_db = {}
 try:
+    parser = argparse.ArgumentParser(add_help=False)
+    parser.add_argument('-s', nargs='?', type=int, dest='replay', const=1,
+                        action='store')
+    args, unknown = parser.parse_known_args()
+    print("Replay: " + str(args.replay))
     print("DUMMY: Obey command-line arguments.")
     print("DUMMY: Open files.")
     setup_server_io(io_db)
-- 
2.30.2