@@ -55,13 +55,13 @@ def main(program, ifname, count):
55
55
56
56
if program == "tcpreplay" :
57
57
args .append (f"--intf1={ ifname } " )
58
- args .append ('-' )
58
+ args .append ("-" )
59
59
60
60
if program == "tcpdump" :
61
61
args .append ("-n" )
62
62
args .append (f"--interface={ ifname } " )
63
63
args .append ("-w" )
64
- args .append ('-' )
64
+ args .append ("-" )
65
65
66
66
if count :
67
67
args .append ("-c" )
@@ -75,22 +75,17 @@ def main(program, ifname, count):
75
75
76
76
if __name__ == "__main__" :
77
77
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" )
88
82
args = parser .parse_args ()
89
83
try :
90
84
main (args .program , args .interface , args .count )
91
85
except Exception as e : # pylint: disable=broad-except
92
86
if args .debug :
93
87
import traceback
88
+
94
89
traceback .print_exc (file = sys .stderr )
95
90
print (f"ERROR: { e } " , file = sys .stderr )
96
91
exit (1 )
0 commit comments