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!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
763B

  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. return parser_top
  16. def main():
  17. zfs_init()
  18. parser = create_parser()
  19. args = parser.parse_args()
  20. if not hasattr(args, 'func'):
  21. sys.exit('You must choose a mode')
  22. args.func(args)
  23. if __name__ == '__main__':
  24. main()