From dff2538f7a9b21c0aaa46accbe0c44f467c6494a Mon Sep 17 00:00:00 2001 From: thinkmorestupidless Date: Fri, 7 Jul 2023 11:38:36 +0100 Subject: [PATCH] added outline 'new' command --- .../com/lunatech/cmt/admin/command/New.scala | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmta/src/main/scala/com/lunatech/cmt/admin/command/New.scala diff --git a/cmta/src/main/scala/com/lunatech/cmt/admin/command/New.scala b/cmta/src/main/scala/com/lunatech/cmt/admin/command/New.scala new file mode 100644 index 00000000..71dcd51d --- /dev/null +++ b/cmta/src/main/scala/com/lunatech/cmt/admin/command/New.scala @@ -0,0 +1,30 @@ +package com.lunatech.cmt.admin.command + +import caseapp.RemainingArgs +import com.lunatech.cmt.CmtError +import com.lunatech.cmt.core.cli.CmtCommand +import com.lunatech.cmt.core.execution.Executable +import com.lunatech.cmt.core.validation.Validatable + +object New: + + final case class Options() + + given Validatable[New.Options] with + extension (options: New.Options) + def validated(): Either[CmtError, New.Options] = + Right(options) + end given + + given Executable[Delinearize.Options] with + extension (options: Delinearize.Options) + def execute(): Either[CmtError, String] = { + ??? + } + + val command = new CmtCommand[New.Options] { + def run(options: New.Options, args: RemainingArgs): Unit = + options.validated().flatMap(_.execute()).printResult() + } + +end New