Esempio n. 1
0
def main():
    try:
        telemetry_session.start()
        mssqlcli_options_parser = create_parser()
        mssqlcli_options = mssqlcli_options_parser.parse_args(sys.argv[1:])
        run_cli_with(mssqlcli_options)
    finally:
        # Upload telemetry async in a separate process.
        telemetry_session.conclude()
Esempio n. 2
0
        if isinstance(formatted, (text_type)):
            formatted = iter(formatted.splitlines())
        first_line = next(formatted)
        formatted = itertools.chain([first_line], formatted)

        if (not expanded and max_width and len(first_line) > max_width
                and headers):
            formatted = formatter.format_output(cur,
                                                headers,
                                                format_name='vertical',
                                                column_types=None,
                                                **output_kwargs)
            if isinstance(formatted, (text_type)):
                formatted = iter(formatted.splitlines())

        output = itertools.chain(output, formatted)

    if status:  # Only print the status if it's not None.
        output = itertools.chain(output, [status])

    return output


if __name__ == "__main__":
    try:
        telemetry_session.start()
        cli()
    finally:
        # Upload telemetry async in a separate process.
        telemetry_session.conclude()