[tor-commits] [arm/master] Removing old argument parsing

atagar at torproject.org atagar at torproject.org
Sun Sep 15 22:29:20 UTC 2013


commit adc4b31c4825af793e9f88a54f687960d15f1544
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Sep 8 16:19:13 2013 -0700

    Removing old argument parsing
    
    Dropping the old getopt usage. Unfortunately blind mode and event logging will
    be a little trickier to replace since the controller uses the config values.
---
 arm/starter.py |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/arm/starter.py b/arm/starter.py
index c6c86c5..8e46932 100644
--- a/arm/starter.py
+++ b/arm/starter.py
@@ -325,18 +325,8 @@ def main():
     print CONFIG['msg.help'] % (ARGS['control_address'], ARGS['control_port'], ARGS['control_socket'], ARGS['config'], LOG_DUMP_PATH, ARGS['logged_events'], arm.logPanel.EVENT_LISTING)
     sys.exit()
 
-  # parses user input, noting any issues
-  try:
-    opts, _ = getopt.getopt(sys.argv[1:], OPT, OPT_EXPANDED)
-  except getopt.GetoptError, exc:
-    print str(exc) + " (for usage provide --help)"
-    sys.exit()
-  
-  for opt, arg in opts:
-    if opt in ("-b", "--blind"):
-      param["startup.blindModeEnabled"] = True        # prevents connection lookups
-    elif opt in ("-e", "--event"):
-      param["startup.events"] = arg                   # set event flags
+  param["startup.blindModeEnabled"] = args.blind
+  param["startup.events"] = args.logged_events
   
   if args.debug:
     try:





More information about the tor-commits mailing list