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

[tor-commits] [torflow/master] Added usage() function



commit 059298f7cf0d3a96a74b966552ebe06992e8dfee
Author: Sathyanarayanan Gunasekaran <gsathya.ceg@xxxxxxxxx>
Date:   Sun Oct 9 16:12:50 2011 +0530

    Added usage() function
---
 NetworkScanners/ExitAuthority/soat.py |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/NetworkScanners/ExitAuthority/soat.py b/NetworkScanners/ExitAuthority/soat.py
index bafe43f..7e43edb 100755
--- a/NetworkScanners/ExitAuthority/soat.py
+++ b/NetworkScanners/ExitAuthority/soat.py
@@ -2638,12 +2638,7 @@ def setup_handler(out_dir, cookie_file, fixed_exits=[]):
   atexit.register(cleanup, *(c, l, f))
   return (c,h)
 
-
-# main logic
-def main(argv):
-  # make sure we have something to test for
-  if len(argv) < 2:
-    print ''
+def usage():
     print 'Please provide at least one test option:'
     print '--pernode=<n>'
     print '--resume=<n>'
@@ -2660,8 +2655,15 @@ def main(argv):
     print '--target=<ip or url>'
     print '--loglevel=<DEBUG|INFO|NOTICE|WARN|ERROR|NONE>'
     print ''
-    return
-  
+    
+	
+# main logic
+def main(argv):
+  # make sure we have something to test for
+  if len(argv) < 2:
+	usage()
+	return
+	
   TorUtil.read_config(data_dir+"/torctl.cfg")
 
   opts = ['ssl','rescan', 'pernode=', 'resume=','http','ssh','smtp','pop','imap','dns','dnsrebind','policies','exit=','target=','loglevel=']



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