From bf7386a21872a155b99bd948a72f538cb61b0c8c Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Sat, 23 Jan 2016 15:42:08 +0100 Subject: [PATCH] Print results of the resolution command on stdout and unindented For easier piping to other processes --- cli/src/main/scala-2.11/coursier/cli/Coursier.scala | 2 +- cli/src/main/scala-2.11/coursier/cli/Helper.scala | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/src/main/scala-2.11/coursier/cli/Coursier.scala b/cli/src/main/scala-2.11/coursier/cli/Coursier.scala index b010e28d5..8dfbaf506 100644 --- a/cli/src/main/scala-2.11/coursier/cli/Coursier.scala +++ b/cli/src/main/scala-2.11/coursier/cli/Coursier.scala @@ -64,7 +64,7 @@ case class Resolve( ) extends CoursierCommand { // the `val helper = ` part is needed because of DelayedInit it seems - val helper = new Helper(common, remainingArgs) + val helper = new Helper(common, remainingArgs, printResultStdout = true) } diff --git a/cli/src/main/scala-2.11/coursier/cli/Helper.scala b/cli/src/main/scala-2.11/coursier/cli/Helper.scala index 62eca141c..169e5643b 100644 --- a/cli/src/main/scala-2.11/coursier/cli/Helper.scala +++ b/cli/src/main/scala-2.11/coursier/cli/Helper.scala @@ -58,7 +58,8 @@ object Util { class Helper( common: CommonOptions, - rawDependencies: Seq[String] + rawDependencies: Seq[String], + printResultStdout: Boolean = false ) { import common._ import Helper.errPrintln @@ -214,7 +215,10 @@ class Helper( val trDeps = res.minDependencies.toVector - if (verbose0 >= 0) + if (printResultStdout) { + errPrintln(s"Result:") + println(Print.dependenciesUnknownConfigs(trDeps)) + } else if (verbose0 >= 0) errPrintln(s"Result:\n${indent(Print.dependenciesUnknownConfigs(trDeps))}") def fetch(