From 492ce2f9cc7bf68e424ab1def6eaac874fae53f1 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Mon, 22 Feb 2021 00:32:29 +0100 Subject: [PATCH] print context, simple pp! for now, better display later --- src/main.cr | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.cr b/src/main.cr index 5934ad9..0a3a85a 100644 --- a/src/main.cr +++ b/src/main.cr @@ -19,6 +19,8 @@ do_not_clean = false watch_only = false skip_build_dependencies = false print_deps = false +only_print_configuration = false + used_X = false OptionParser.parse do |parser| @@ -77,6 +79,10 @@ OptionParser.parse do |parser| skip_build_dependencies = true } + parser.on("-p", "--print-configuration", "Only print configuration.") { + only_print_configuration = true + } + parser.invalid_option do |flag| STDERR.puts "ERROR: #{flag} is not a valid option." STDERR.puts parser @@ -95,6 +101,11 @@ elsif configuration_file_requested exit 1 end +if only_print_configuration + pp! context + exit 0 +end + found_recipes = requested_recipes.map do |name| context.find_recipe(name) || name end