# Path: awscfncli2/cli/utils/deco.py
# def command_exception_handler(f):
#     """Capture and pretty print exceptions."""
# 
#     @wraps(f)
#     def wrapper(ctx, *args, **kwargs):
#         try:
#             return f(ctx, *args, **kwargs)
#         except (botocore.exceptions.ClientError,
#                 botocore.exceptions.BotoCoreError,
#                 ) as e:
#             if ctx.obj.verbosity > 0:
#                 click.secho(traceback.format_exc(), fg='red')
#             else:
#                 click.secho(str(e), fg='red')
#             raise click.Abort
#         except ConfigError as e:
#             click.secho(str(e), fg='red')
#             if ctx.obj.verbosity > 0:
#                 traceback.print_exc()
#             raise click.Abort
# 
#     return wrapper
# 
# Path: awscfncli2/runner/commands/stack_status_command.py
# class StackStatusOptions(namedtuple('StackStatusOptions',
#                                     ['dry_run', 'stack_resources',
#                                      'stack_exports'])):
#     pass
# 
# class StackStatusCommand(Command):
#     SKIP_UPDATE_REFERENCES = True
# 
#     def run(self, stack_context):
#         # stack contexts
#         session = stack_context.session
#         parameters = stack_context.parameters
#         metadata = stack_context.metadata
# 
#         self.ppt.pprint_stack_name(stack_context.stack_key,
#                                    parameters['StackName'])
#         # shortcut since dry run is already handled in cli package
#         if self.options.dry_run:
#             return
# 
#         # metadata and parameters only get printed when verbosity>0
#         self.ppt.pprint_metadata(metadata)
#         self.ppt.pprint_parameters(parameters)
# 
#         cfn = session.resource('cloudformation')
#         stack = cfn.Stack(parameters['StackName'])
# 
#         try:
#             stack.stack_status
#         except botocore.exceptions.ClientError as ex:
#             if is_stack_does_not_exist_exception(ex):
#                 # make a "dummy" stack object so prettyprint is happy
#                 stack = dummy_stack(parameters['StackName'], 'STACK_NOT_FOUND')
#                 self.ppt.pprint_stack(stack, status=True)
#                 return
#             else:
#                 raise
# 
#         self.ppt.pprint_stack(stack, status=True)
# 
#         if self.options.stack_resources:
#             self.ppt.pprint_stack_resources(stack)
# 
#         if self.options.stack_exports:
#             self.ppt.pprint_stack_parameters(stack)
#             self.ppt.pprint_stack_exports(stack, session)
#             client = session.client('cloudformation')


import click
from awscfncli2.cli.utils.deco import command_exception_handler
from awscfncli2.runner.commands.stack_status_command import StackStatusOptions, StackStatusCommand



@click.command('status')
@click.option('--dry-run', '-d', is_flag=True, default=False,
              help='Don\'t retrieve stack deployment status (faster).')
@click.option('--stack-resources', '-r', is_flag=True, default=False,
              help='Display stack resources.')
@click.option('--stack-exports', '-e', is_flag=True, default=False,
              help='Display stack exports.')
@click.pass_context

# Path: awscfncli2/cli/utils/deco.py
# def command_exception_handler(f):
#     """Capture and pretty print exceptions."""
# 
#     @wraps(f)
#     def wrapper(ctx, *args, **kwargs):
#         try:
#             return f(ctx, *args, **kwargs)
#         except (botocore.exceptions.ClientError,
#                 botocore.exceptions.BotoCoreError,
#                 ) as e:
#             if ctx.obj.verbosity > 0:
#                 click.secho(traceback.format_exc(), fg='red')
#             else:
#                 click.secho(str(e), fg='red')
#             raise click.Abort
#         except ConfigError as e:
#             click.secho(str(e), fg='red')
#             if ctx.obj.verbosity > 0:
#                 traceback.print_exc()
#             raise click.Abort
# 
#     return wrapper
# 
# Path: awscfncli2/runner/commands/stack_status_command.py
# class StackStatusOptions(namedtuple('StackStatusOptions',
#                                     ['dry_run', 'stack_resources',
#                                      'stack_exports'])):
#     pass
# 
# class StackStatusCommand(Command):
#     SKIP_UPDATE_REFERENCES = True
# 
#     def run(self, stack_context):
#         # stack contexts
#         session = stack_context.session
#         parameters = stack_context.parameters
#         metadata = stack_context.metadata
# 
#         self.ppt.pprint_stack_name(stack_context.stack_key,
#                                    parameters['StackName'])
#         # shortcut since dry run is already handled in cli package
#         if self.options.dry_run:
#             return
# 
#         # metadata and parameters only get printed when verbosity>0
#         self.ppt.pprint_metadata(metadata)
#         self.ppt.pprint_parameters(parameters)
# 
#         cfn = session.resource('cloudformation')
#         stack = cfn.Stack(parameters['StackName'])
# 
#         try:
#             stack.stack_status
#         except botocore.exceptions.ClientError as ex:
#             if is_stack_does_not_exist_exception(ex):
#                 # make a "dummy" stack object so prettyprint is happy
#                 stack = dummy_stack(parameters['StackName'], 'STACK_NOT_FOUND')
#                 self.ppt.pprint_stack(stack, status=True)
#                 return
#             else:
#                 raise
# 
#         self.ppt.pprint_stack(stack, status=True)
# 
#         if self.options.stack_resources:
#             self.ppt.pprint_stack_resources(stack)
# 
#         if self.options.stack_exports:
#             self.ppt.pprint_stack_parameters(stack)
#             self.ppt.pprint_stack_exports(stack, session)
#             client = session.client('cloudformation')


# Path: awscfncli2/cli/commands/status/status.py
import click
from awscfncli2.cli.utils.deco import command_exception_handler
from awscfncli2.runner.commands.stack_status_command import StackStatusOptions, StackStatusCommand




@click.command('status')
@click.option('--dry-run', '-d', is_flag=True, default=False,
              help='Don\'t retrieve stack deployment status (faster).')
@click.option('--stack-resources', '-r', is_flag=True, default=False,
              help='Display stack resources.')
@click.option('--stack-exports', '-e', is_flag=True, default=False,
              help='Display stack exports.')
@click.pass_context

@command_exception_handler