Пример #1
0
def main():
    check_for_update()

    if len(sys.argv) == 1:
        print_help()
        sys.exit(0)
    else:
        module = sys.argv[1]
        args = sys.argv[2:]
        if module == 'version':
            print_version()
        elif module == 'dataproc':
            from hailtop.hailctl.dataproc import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'auth':
            from hailtop.hailctl.auth import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'dev':
            from hailtop.hailctl.dev import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'batch':
            from hailtop.hailctl.batch import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'curl':
            from hailtop.hailctl.curl import main  # pylint: disable=import-outside-toplevel
            main(args)
        elif module == 'config':
            from hailtop.hailctl.config import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module in ('-h', '--help', 'help'):
            print_help()
        else:
            sys.stderr.write(f"ERROR: no such module: {module!r}")
            print_help()
            sys.exit(1)
Пример #2
0
        if module == 'version':
            print_version()
        elif module == 'dataproc':
            from hailtop.hailctl.dataproc import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'auth':
            from hailtop.hailctl.auth import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'dev':
            from hailtop.hailctl.dev import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'batch':
            from hailtop.hailctl.batch import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module == 'curl':
            from hailtop.hailctl.curl import main  # pylint: disable=import-outside-toplevel
            main(args)
        elif module == 'config':
            from hailtop.hailctl.config import cli  # pylint: disable=import-outside-toplevel
            cli.main(args)
        elif module in ('-h', '--help', 'help'):
            print_help()
        else:
            sys.stderr.write(f"ERROR: no such module: {module!r}")
            print_help()
            sys.exit(1)


if __name__ == '__main__':
    main()