mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Move commands into their own files.
This commit is contained in:
parent
111ed02938
commit
cdfd3f7670
16 changed files with 736 additions and 673 deletions
|
|
@ -1,7 +1,13 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import argparse
|
||||
|
||||
from pre_commit import color
|
||||
from pre_commit import commands
|
||||
from pre_commit.commands.autoupdate import autoupdate
|
||||
from pre_commit.commands.clean import clean
|
||||
from pre_commit.commands.install import install
|
||||
from pre_commit.commands.run import run
|
||||
from pre_commit.commands.uninstall import uninstall
|
||||
from pre_commit.runner import Runner
|
||||
from pre_commit.util import entry
|
||||
|
||||
|
|
@ -51,15 +57,15 @@ def main(argv):
|
|||
runner = Runner.create()
|
||||
|
||||
if args.command == 'install':
|
||||
return commands.install(runner)
|
||||
return install(runner)
|
||||
elif args.command == 'uninstall':
|
||||
return commands.uninstall(runner)
|
||||
return uninstall(runner)
|
||||
elif args.command == 'clean':
|
||||
return commands.clean(runner)
|
||||
return clean(runner)
|
||||
elif args.command == 'autoupdate':
|
||||
return commands.autoupdate(runner)
|
||||
return autoupdate(runner)
|
||||
elif args.command == 'run':
|
||||
return commands.run(runner, args)
|
||||
return run(runner, args)
|
||||
elif args.command == 'help':
|
||||
if args.help_cmd:
|
||||
parser.parse_args([args.help_cmd, '--help'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue