import asyncio
from pathlib import Path

import click


async def _inner(manifest_paths, auto_confirm):
    import netlab.builder

    await netlab.builder.main(manifest_paths, auto_confirm)


@click.command()
# @click.option("--system", default="default", help="NETLAB+ system to communicate with.")
# @click.option("--jobs", default=1, type=click.IntRange(min=1), help="Number of jobs to run in parallel.")
# @click.option("--jobs_spacing", default=0, type=click.FloatRange(), help="")
@click.option("--yes", "-y", type=bool, is_flag=True)
@click.argument("manifest_paths", type=click.Path(exists=True, readable=True, dir_okay=False, path_type=Path), nargs=1)
@click.pass_context
def build(ctx, manifest_paths: Path, yes):
    # click.confirm("Continue?")
    asyncio.run(_inner([manifest_paths], auto_confirm=yes))
