[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [arm/master] Using new argument parsing in parallel with the old version



commit a4e399176efaa9c5ff379e1fe3142a01864ea15d
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Sep 8 14:32:02 2013 -0700

    Using new argument parsing in parallel with the old version
    
    Calling our new arg parsing funciton, though for the moment ignoring its
    output. Functionally this adds the validation it does, and nothing more. Next I
    plan to replace the old arguments one by one...
---
 arm/starter.py |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arm/starter.py b/arm/starter.py
index bae9a64..37c048d 100644
--- a/arm/starter.py
+++ b/arm/starter.py
@@ -315,10 +315,19 @@ def main():
   param = dict([(key, None) for key in CONFIG.keys()])
   isDebugMode = False
   configPath = DEFAULT_CONFIG # path used for customized configuration
-  
+
+  try:
+    args = _get_args(sys.argv[1:])
+  except getopt.GetoptError as exc:
+    print "%s (for usage provide --help)" % exc
+    sys.exit(1)
+  except ValueError as exc:
+    print exc
+    sys.exit(1)
+
   # parses user input, noting any issues
   try:
-    opts, args = getopt.getopt(sys.argv[1:], OPT, OPT_EXPANDED)
+    opts, _ = getopt.getopt(sys.argv[1:], OPT, OPT_EXPANDED)
   except getopt.GetoptError, exc:
     print str(exc) + " (for usage provide --help)"
     sys.exit()



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits