# Path: aeriscloud/cli/helpers.py
# def standard_options(multiple=False, start_prompt=True):
#     """
#     Add the standard --project and --box options to a command
#     :param multiple: Whether to find a single or multiple boxes
#     :param start_prompt: When using single boxes, ask the user to start it if
#                          offline
#     """
#     if multiple:
#         return _multi_box_decorator
#     else:
#         return _single_box_decorator(start_prompt)
# 
# class Command(click.Command):
#     # This is inherited by the Context to switch between pure POSIX and
#     # argparse-like argument parsing. Setting it to false will push any
#     # unknown flag to the argument located where the flag was declared
#     allow_interspersed_args = config.get('config', 'posix', default=False)
# 
#     def __init__(self, *args, **kwargs):
#         cs = dict(help_option_names=['-h', '--help'])
#         super(Command, self).__init__(context_settings=cs,
#                                       *args, **kwargs)
# 
# def render_cli(template, **kwargs):
#     env = jinja_env('aeriscloud.cli', 'templates')
#     template = env.get_template(template + '.j2')
#     kwargs['fg'] = JinjaColors()
#     kwargs['bold'] = click.style('', bold=True, reset=False)
#     kwargs['reset'] = click.style('')
#     return template.render(**kwargs)
# 
# Path: aeriscloud/utils.py
# def timestamp(text, **kwargs):
#     """
#     Writes text with a timestamp
#     :param text:
#     :return:
#     """
#     for line in text.split('\n'):
#         # TODO: something we could do is detect the last ansi code on each
#         # line and report it to the next line so that multiline codes
#         # are not reset/lost
#         secho('[%s] ' % (now().format('HH:mm:ss')), fg='reset', nl=False)
#         secho(line, **kwargs)


import click
from aeriscloud.cli.helpers import standard_options, Command, render_cli
from aeriscloud.utils import timestamp
#!/usr/bin/env python




@click.command(cls=Command)
@click.argument('extra', nargs=-1)
@standard_options()
def cli(box, extra):
    """
    Provision a box
    """
    res = box.vagrant('provision', *extra)

    if res == 0:

# Path: aeriscloud/cli/helpers.py
# def standard_options(multiple=False, start_prompt=True):
#     """
#     Add the standard --project and --box options to a command
#     :param multiple: Whether to find a single or multiple boxes
#     :param start_prompt: When using single boxes, ask the user to start it if
#                          offline
#     """
#     if multiple:
#         return _multi_box_decorator
#     else:
#         return _single_box_decorator(start_prompt)
# 
# class Command(click.Command):
#     # This is inherited by the Context to switch between pure POSIX and
#     # argparse-like argument parsing. Setting it to false will push any
#     # unknown flag to the argument located where the flag was declared
#     allow_interspersed_args = config.get('config', 'posix', default=False)
# 
#     def __init__(self, *args, **kwargs):
#         cs = dict(help_option_names=['-h', '--help'])
#         super(Command, self).__init__(context_settings=cs,
#                                       *args, **kwargs)
# 
# def render_cli(template, **kwargs):
#     env = jinja_env('aeriscloud.cli', 'templates')
#     template = env.get_template(template + '.j2')
#     kwargs['fg'] = JinjaColors()
#     kwargs['bold'] = click.style('', bold=True, reset=False)
#     kwargs['reset'] = click.style('')
#     return template.render(**kwargs)
# 
# Path: aeriscloud/utils.py
# def timestamp(text, **kwargs):
#     """
#     Writes text with a timestamp
#     :param text:
#     :return:
#     """
#     for line in text.split('\n'):
#         # TODO: something we could do is detect the last ansi code on each
#         # line and report it to the next line so that multiline codes
#         # are not reset/lost
#         secho('[%s] ' % (now().format('HH:mm:ss')), fg='reset', nl=False)
#         secho(line, **kwargs)


# Path: aeriscloud/cli/aeris/provision.py
import click
from aeriscloud.cli.helpers import standard_options, Command, render_cli
from aeriscloud.utils import timestamp

#!/usr/bin/env python




@click.command(cls=Command)
@click.argument('extra', nargs=-1)
@standard_options()
def cli(box, extra):
    """
    Provision a box
    """
    res = box.vagrant('provision', *extra)

    if res == 0:

        timestamp(render_cli('provision-success', box=box))