# 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)


import arrow
import click
import re
import sys
from aeriscloud.cli.helpers import standard_options, Command, render_cli

    for deployment in history:
        ansible = {'extra': [], 'modules': {}}
        for line in deployment['ansible_version'].split('\n'):
            line = line.strip()

            match = av.match(line)
            if match:
                ansible['version'] = match.group(1)
                if match.group(2):
                    ansible['rev'] = match.group(3)
                    ansible['last_update'] = arrow.get(match.group(4),
                                                       'YYYY/MM/DD HH:mm:ss')
                continue

            match = mv.match(line)
            if match:
                ansible['modules'][match.group(1)] = {
                    'rev': match.group(2),
                    'last_update': arrow.get(match.group(3),
                                             'YYYY/MM/DD HH:mm:ss')
                }
                continue

            ansible['extra'].append(line)

        deployment['date'] = arrow.get(deployment['date'],
                                       'DD MMM YYYY HH:mm:ss Z')
        deployment['ansible_version'] = ansible


# 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/cli/aeris/history.py
import arrow
import click
import re
import sys
from aeriscloud.cli.helpers import standard_options, Command, render_cli


    for deployment in history:
        ansible = {'extra': [], 'modules': {}}
        for line in deployment['ansible_version'].split('\n'):
            line = line.strip()

            match = av.match(line)
            if match:
                ansible['version'] = match.group(1)
                if match.group(2):
                    ansible['rev'] = match.group(3)
                    ansible['last_update'] = arrow.get(match.group(4),
                                                       'YYYY/MM/DD HH:mm:ss')
                continue

            match = mv.match(line)
            if match:
                ansible['modules'][match.group(1)] = {
                    'rev': match.group(2),
                    'last_update': arrow.get(match.group(3),
                                             'YYYY/MM/DD HH:mm:ss')
                }
                continue

            ansible['extra'].append(line)

        deployment['date'] = arrow.get(deployment['date'],
                                       'DD MMM YYYY HH:mm:ss Z')
        deployment['ansible_version'] = ansible


    click.echo(render_cli('history', history=history, quiet=quiet), nl=False)