IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

33 rindas
836B

  1. from argparse import ArgumentParser
  2. import yaml
  3. import os
  4. # from weir import zfs, process
  5. from .image import command_image_build
  6. import sys
  7. from .zfs import zfs_init
  8. def create_parser():
  9. parser_top = ArgumentParser()
  10. subparsers_top = parser_top.add_subparsers()
  11. subparsers = subparsers_top.add_parser('image').add_subparsers()
  12. parser = subparsers.add_parser('build')
  13. parser.set_defaults(func=command_image_build)
  14. parser.add_argument('focker_dir', type=str)
  15. parser.add_argument('--tag', '-t', type=str, nargs='+', default=[])
  16. return parser_top
  17. def main():
  18. zfs_init()
  19. parser = create_parser()
  20. args = parser.parse_args()
  21. if not hasattr(args, 'func'):
  22. sys.exit('You must choose a mode')
  23. args.func(args)
  24. if __name__ == '__main__':
  25. main()