Refactored how entry points work.

This commit is contained in:
Anthony Sottile 2014-03-22 18:21:54 -07:00
parent 5db7f2d807
commit 45741545dc
8 changed files with 71 additions and 42 deletions

View file

@ -3,7 +3,10 @@ from __future__ import print_function
import sys
from pre_commit_hooks.util import entry
@entry
def validate_files(argv):
retcode = 0
for filename in argv:
@ -18,9 +21,5 @@ def validate_files(argv):
return retcode
def entry():
return validate_files(sys.argv[1:])
if __name__ == '__main__':
sys.exit(entry())