From 99d53692ba22a5b1acafc450c602d3bb30573739 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 3 Jul 2014 12:37:34 +0200 Subject: [PATCH] isl_cat: add --yaml-style option This is useful for printing schedules. Signed-off-by: Sven Verdoolaege --- cat.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cat.c b/cat.c index 8ab4895a..4f871331 100644 --- a/cat.c +++ b/cat.c @@ -13,15 +13,24 @@ struct isl_arg_choice cat_format[] = { {0} }; +struct isl_arg_choice cat_yaml_style[] = { + { "block", ISL_YAML_STYLE_BLOCK }, + { "flow", ISL_YAML_STYLE_FLOW }, + { 0 } +}; + struct cat_options { struct isl_options *isl; unsigned format; + unsigned yaml_style; }; ISL_ARGS_START(struct cat_options, cat_options_args) ISL_ARG_CHILD(struct cat_options, isl, "isl", &isl_options_args, "isl options") ISL_ARG_CHOICE(struct cat_options, format, 0, "format", \ cat_format, ISL_FORMAT_ISL, "output format") +ISL_ARG_CHOICE(struct cat_options, yaml_style, 0, "yaml-style", \ + cat_yaml_style, ISL_YAML_STYLE_BLOCK, "output YAML style") ISL_ARGS_END ISL_ARG_DEF(cat_options, struct cat_options, cat_options_args) @@ -46,6 +55,7 @@ int main(int argc, char **argv) p = isl_printer_to_file(ctx, stdout); p = isl_printer_set_output_format(p, options->format); + p = isl_printer_set_yaml_style(p, options->yaml_style); p = obj.type->print(p, obj.v); p = isl_printer_end_line(p); isl_printer_free(p); -- 2.11.4.GIT