@@ -2845,7 +2845,7 @@ def __init__(self, value):
2845
2845
description = 'disassemble one or more pickle files' )
2846
2846
parser .add_argument (
2847
2847
'pickle_file' ,
2848
- nargs = '* ' , help = 'the pickle file' )
2848
+ nargs = '+ ' , help = 'the pickle file' )
2849
2849
parser .add_argument (
2850
2850
'-o' , '--output' ,
2851
2851
help = 'the file where the output should be written' )
@@ -2863,26 +2863,23 @@ def __init__(self, value):
2863
2863
help = 'if more than one pickle file is specified, print this before'
2864
2864
' each disassembly' )
2865
2865
args = parser .parse_args ()
2866
- if not args .pickle_file :
2867
- parser .print_help ()
2866
+ annotate = 30 if args .annotate else 0
2867
+ memo = {} if args .memo else None
2868
+ if args .output is None :
2869
+ output = sys .stdout
2868
2870
else :
2869
- annotate = 30 if args .annotate else 0
2870
- memo = {} if args .memo else None
2871
- if args .output is None :
2872
- output = sys .stdout
2873
- else :
2874
- output = open (args .output , 'w' )
2875
- try :
2876
- for arg in args .pickle_file :
2877
- if len (args .pickle_file ) > 1 :
2878
- name = '<stdin>' if arg == '-' else arg
2879
- preamble = args .preamble .format (name = name )
2880
- output .write (preamble + '\n ' )
2881
- if arg == '-' :
2882
- dis (sys .stdin .buffer , output , memo , args .indentlevel , annotate )
2883
- else :
2884
- with open (arg , 'rb' ) as f :
2885
- dis (f , output , memo , args .indentlevel , annotate )
2886
- finally :
2887
- if output is not sys .stdout :
2888
- output .close ()
2871
+ output = open (args .output , 'w' )
2872
+ try :
2873
+ for arg in args .pickle_file :
2874
+ if len (args .pickle_file ) > 1 :
2875
+ name = '<stdin>' if arg == '-' else arg
2876
+ preamble = args .preamble .format (name = name )
2877
+ output .write (preamble + '\n ' )
2878
+ if arg == '-' :
2879
+ dis (sys .stdin .buffer , output , memo , args .indentlevel , annotate )
2880
+ else :
2881
+ with open (arg , 'rb' ) as f :
2882
+ dis (f , output , memo , args .indentlevel , annotate )
2883
+ finally :
2884
+ if output is not sys .stdout :
2885
+ output .close ()
0 commit comments