File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -193,14 +193,18 @@ def _get_version():
193
193
194
194
def main (prog = None , args = None ):
195
195
"""Entry point for the script "pyflakes"."""
196
- import optparse
196
+ import argparse
197
197
198
198
# Handle "Keyboard Interrupt" and "Broken pipe" gracefully
199
199
_exitOnSignal ('SIGINT' , '... stopped' )
200
200
_exitOnSignal ('SIGPIPE' , 1 )
201
201
202
- parser = optparse .OptionParser (prog = prog , version = _get_version ())
203
- (__ , args ) = parser .parse_args (args = args )
202
+ parser = argparse .ArgumentParser (prog = prog ,
203
+ description = 'Check Python source files for errors' )
204
+ parser .add_argument ('-V' , '--version' , action = 'version' , version = _get_version ())
205
+ parser .add_argument ('path' , nargs = '*' ,
206
+ help = 'Path(s) of Python file(s) to check. STDIN if not given.' )
207
+ args = parser .parse_args (args = args ).path
204
208
reporter = modReporter ._makeDefaultReporter ()
205
209
if args :
206
210
warnings = checkRecursive (args , reporter )
You can’t perform that action at this time.
0 commit comments