# Path: aeriscloud/ansible.py
# def shell(inventory, *args, **kwargs):
#     env = ansible_env(os.environ.copy())
#     cmd = ['ansible-console', '-i', get_inventory_file(inventory)] + list(args)
# 
#     if verbosity():
#         cmd += ['-' + ('v' * verbosity())]
# 
#     logger.info('running %s', ' '.join(cmd))
#     logger.debug('env: %r', env)
# 
#     return call(cmd, start_new_session=True, env=env, **kwargs)
# 
# Path: aeriscloud/cli/helpers.py
# 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)


import click
from aeriscloud.ansible import shell
from aeriscloud.cli.helpers import Command



@click.command(cls=Command)
@click.argument('inventory')
@click.argument('extra', nargs=-1)
def cli(inventory, extra):
    """
    Open a shell on multiple remote servers.
    """
    try:

# Path: aeriscloud/ansible.py
# def shell(inventory, *args, **kwargs):
#     env = ansible_env(os.environ.copy())
#     cmd = ['ansible-console', '-i', get_inventory_file(inventory)] + list(args)
# 
#     if verbosity():
#         cmd += ['-' + ('v' * verbosity())]
# 
#     logger.info('running %s', ' '.join(cmd))
#     logger.debug('env: %r', env)
# 
#     return call(cmd, start_new_session=True, env=env, **kwargs)
# 
# Path: aeriscloud/cli/helpers.py
# 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)


# Path: aeriscloud/cli/cloud/shell.py
import click
from aeriscloud.ansible import shell
from aeriscloud.cli.helpers import Command




@click.command(cls=Command)
@click.argument('inventory')
@click.argument('extra', nargs=-1)
def cli(inventory, extra):
    """
    Open a shell on multiple remote servers.
    """
    try:

        shell(inventory, *extra)