@@ -55,13 +55,13 @@ def main(program, ifname, count):
5555
5656 if program == "tcpreplay" :
5757 args .append (f"--intf1={ ifname } " )
58- args .append ('-' )
58+ args .append ("-" )
5959
6060 if program == "tcpdump" :
6161 args .append ("-n" )
6262 args .append (f"--interface={ ifname } " )
6363 args .append ("-w" )
64- args .append ('-' )
64+ args .append ("-" )
6565
6666 if count :
6767 args .append ("-c" )
@@ -75,22 +75,17 @@ def main(program, ifname, count):
7575
7676if __name__ == "__main__" :
7777 parser = argparse .ArgumentParser ()
78- parser .add_argument (
79- '-d' ,
80- '--debug' ,
81- action = 'store_true' ,
82- default = False ,
83- help = "enable debug mode"
84- )
85- parser .add_argument ('program' , type = str , help = 'program to run, either tcpreplay or tcpdump' )
86- parser .add_argument ('interface' , type = str , help = 'interface name' )
87- parser .add_argument ('count' , nargs = "?" , type = int , default = None , help = 'amount of frames to capture while recording' )
78+ parser .add_argument ("-d" , "--debug" , action = "store_true" , default = False , help = "enable debug mode" )
79+ parser .add_argument ("program" , type = str , help = "program to run, either tcpreplay or tcpdump" )
80+ parser .add_argument ("interface" , type = str , help = "interface name" )
81+ parser .add_argument ("count" , nargs = "?" , type = int , default = None , help = "amount of frames to capture while recording" )
8882 args = parser .parse_args ()
8983 try :
9084 main (args .program , args .interface , args .count )
9185 except Exception as e : # pylint: disable=broad-except
9286 if args .debug :
9387 import traceback
88+
9489 traceback .print_exc (file = sys .stderr )
9590 print (f"ERROR: { e } " , file = sys .stderr )
9691 exit (1 )
0 commit comments