[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [onionperf/master] Print out help if no argument is given.
commit 52d9c2f02751530cd7767b99acd419654156b5a7
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Wed May 13 21:25:08 2020 +0200
Print out help if no argument is given.
This has changed since moving from Python 2 to 3.
Patch by acute. Fixes #34208.
---
onionperf/onionperf | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/onionperf/onionperf b/onionperf/onionperf
index cb1899c..a61fd73 100755
--- a/onionperf/onionperf
+++ b/onionperf/onionperf
@@ -347,8 +347,12 @@ files generated by this script will be written""",
default=util.LINEFORMATS)
# get args and call the command handler for the chosen mode
- args = main_parser.parse_args()
- args.func(args)
+ if len(sys.argv) == 1:
+ main_parser.print_help()
+ sys.exit(1)
+ else:
+ args = main_parser.parse_args()
+ args.func(args)
def monitor(args):
from onionperf.monitor import TorMonitor
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits