main.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. """
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2024/07/22
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : enter point
  8. """
  9. from regex import P
  10. from auto_commit.utils.colors import bcolors
  11. from auto_commit.auto_commit import AutoCommit
  12. from auto_commit.options import parse_args
  13. if __name__=='__main__':
  14. args = parse_args()
  15. print(args['cmd'])
  16. try:
  17. if args['path'] is not None and args['cmd'] is not None:
  18. if args['cmd'] == 'commit':
  19. auto_commit = AutoCommit(params=args)
  20. auto_commit.commit()
  21. elif args['cmd'] == 'sync':
  22. auto_commit = AutoCommit(params=args)
  23. auto_commit.sync()
  24. elif args['cmd'] == 'help':
  25. print('help')
  26. elif args['cmd'] == 'version':
  27. print('version')
  28. else:
  29. print(f"{bcolors.FAIL}Please input path {bcolors.ENDC}")
  30. except Exception as e:
  31. print(e)
  32. print(f"{bcolors.FAIL}Please input path {bcolors.ENDC}")