Commits

Ian Cordasco committed cd2e99c

Filter out our options before passing to pep8

Update the .hgignore with a few pet peeves.

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.