-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
741 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
commands/src/main/scala/com/reactific/riddl/commands/DotWritingProgressMonitor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2019 Ossum, Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.reactific.riddl.commands | ||
|
||
import com.reactific.riddl.language.CommonOptions | ||
import com.reactific.riddl.utils.Logger | ||
import org.eclipse.jgit.lib.ProgressMonitor | ||
|
||
import java.io.PrintStream | ||
|
||
case class DotWritingProgressMonitor(out: PrintStream, log: Logger, | ||
options: CommonOptions) | ||
extends ProgressMonitor { | ||
override def start(totalTasks: Int): Unit = { | ||
if (options.verbose) { log.info(s"Starting Fetch with $totalTasks tasks.") } | ||
else { out.print("\n.") } | ||
} | ||
|
||
override def beginTask(title: String, totalWork: Int): Unit = { | ||
if (options.verbose) { | ||
log.info(s"Starting Task '$title', $totalWork remaining.") | ||
} else { out.print(".") } | ||
} | ||
|
||
override def update(completed: Int): Unit = { | ||
if (options.verbose) { log.info(s"$completed tasks completed.") } | ||
else { out.print(".") } | ||
} | ||
|
||
override def endTask(): Unit = { | ||
if (options.verbose) { log.info(s"Task completed.") } | ||
else { out.println(".") } | ||
} | ||
|
||
override def isCancelled: Boolean = false | ||
} |
Oops, something went wrong.