Commits

Ian Cordasco committed cd2e99c

Filter out our options before passing to pep8

Update the .hgignore with a few pet peeves.

  • Participants
  • Parent commits 6406a34
  • Branches refactor

Comments (0)

Files changed (2)

 flake8.egg-info
 man
 \.Python
+nose*
+.*\.swp
         sys.exit(0)
 
     # Create our own parser
-    parser = optparse.OptionParser('%prog [options]', version=version)
+    parser = optparse.OptionParser('%prog [options] [file.py|directory]',
+                                   version=version)
     parser.version = '{0} (pep8: {1}, flakey: {2})'.format(
         __version__, pep8.__version__, flakey.__version__)
     parser.remove_option('--version')
 def main():
     global pep8style
 
+    # parse out our flags so pep8 doesn't get confused
     parser = get_parser()
-    # parse our flags
-    opts, args = parser.parse_args()
+    opts, sys.argv = parser.parse_args()
+
+    # make sure pep8 gets the information it expects
+    sys.argv.insert(0, 'pep8')
 
     pep8style = pep8.StyleGuide(parse_argv=True, config_file=True)
     options = pep8style.options