From 7b57a2706d4343dfdbe008cd8eb34e506a000e1f Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Wed, 4 Sep 2019 19:53:15 +0200 Subject: [PATCH] -B, --print-deps option added. --- src/main.cr | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cr b/src/main.cr index 116b9cd..164058b 100644 --- a/src/main.cr +++ b/src/main.cr @@ -19,6 +19,7 @@ download_only = false do_not_clean = false watch_only = false skip_build_dependencies = false +print_deps = false used_X = false OptionParser.parse! do |parser| @@ -61,6 +62,10 @@ OptionParser.parse! do |parser| watch_only = true } + parser.on("-B", "--print-deps", "Prints build dependencies and exits.") { + print_deps = true + } + parser.on("-v", "--verbose", "Runs more verbosely.") { context.verbosity += 1 } @@ -137,6 +142,11 @@ begin end end + if print_deps + puts dependencies.join "\n" + exit 0 + end + if dependencies.size > 0 && ! skip_build_dependencies && !download_only # FIXME: We’ll probably want to have backends other than apk at some point. opts = ["add"] + (ENV["APK_FLAGS"]? || "-i").split(/[ \t]+/) + dependencies