+logger = logging.getLogger("osmclient")
+
+
+def evaluate_output_format(ctx, param, value):
+ logger.debug("")
+ if value in ["table", "json", "yaml", "csv"]:
+ return value
+ elif value.startswith("jsonpath="):
+ return value
+ else:
+ raise click.BadParameter(
+ f"{value} is not one of 'table', 'json', 'yaml', 'csv', 'jsonpath'"
+ )
+
+
+output_option = click.option(
+ "-o",
+ "--output",
+ default="table",
+ is_eager=True,
+ callback=evaluate_output_format,
+ help="output format (default: table)",
+)
+
+
+literal_option = click.option(
+ "--literal", is_flag=True, help="print literally, no pretty table"
+)
+
+
+def print_output(format="table", headers=["field", "value"], rows=[], data=None):
+ """
+ Prints content in specified format.
+ :param format: output format (table, yaml, json, csv, jsonpath=...). Default:
+ :param headers: headers of the content
+ :param rows: rows of the content
+ :param data: dictionary or list with the content to be printed. Only applies to yaml, json or jsonpath format.
+ If specified, headers and rows are ignored, and json/yaml/jsonpath output is generated directly from data.
+ """
+
+ logger.debug("")