Skip to content

Commit

Permalink
added outline 'new' command
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkmorestupidless committed Jul 7, 2023
1 parent fd88865 commit dff2538
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions cmta/src/main/scala/com/lunatech/cmt/admin/command/New.scala
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dff2538

Please sign in to comment.