[main] inline exec

This commit is contained in:
Paul Campbell 2019-04-30 09:40:07 +01:00
parent c8c652fe2d
commit 598bd77a03

View file

@ -6,16 +6,13 @@ import cats.syntax.all._
object Main extends IOApp {
def exec(args: List[String]): IO[ExitCode] =
for {
ec <- IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success)
} yield ec
override def run(args: List[String]): IO[ExitCode] =
exec(args).guaranteeCase {
case Canceled => IO(println("Interrupted"))
case Error(e) => IO(println("ERROR: " + e))
case Completed => IO(println("Done"))
}
(for {
ec <- IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success)
} yield ec).guaranteeCase {
case Canceled => IO(println("Interrupted"))
case Error(e) => IO(println("ERROR: " + e))
case Completed => IO(println("Done"))
}
}