Print config entry function.

def print_config():  # pragma: no cover
    """Print config entry function."""
    description = """\
        Print the deployment settings for a Pyramid application.  Example:
        'psettings deployment.ini'
    """
    parser = argparse.ArgumentParser(
        description=textwrap.dedent(description)
    )
    parser.add_argument(
        'config_uri', type=str, help='an integer for the accumulator'
    )
    parser.add_argument(
        '-k', '--key',
        dest='key',
        metavar='PREFIX',
        type=str,
        action='store',
        help=(
            "Tells script to print only specified"
            " config tree provided by dotted name"
        )
    )
    args = parser.parse_args(sys.argv[1:])

    config_uri = args.config_uri
    env = bootstrap(config_uri)
    config, closer = env['registry']['config'], env['closer']

    try:
        print(printer(slice_config(config, args.key)))
    except KeyError:
        print(
            'Sorry, but the key path {0}, does not exists in Your config!'
            .format(args.key)
        )
    finally:
        closer()