Skip to content

Commit

Permalink
Remove Plugin Cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
reid-spencer committed Aug 25, 2024
1 parent 2af1148 commit 37a0a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import scopt.OParser
import java.io.File
import java.nio.file.Path

object InputFileCommandPlugin {
object InputFileCommand {
case class Options(inputFile: Option[Path] = None, command: String = "unspecified") extends CommandOptions
}

/** An abstract command definition helper class for commands that only take a single input file parameter
* @param name
* The name of the command
*/
abstract class InputFileCommandPlugin(name: String) extends Command[InputFileCommandPlugin.Options](name) {
import InputFileCommandPlugin.Options
abstract class InputFileCommand(name: String) extends Command[InputFileCommand.Options](name) {
import InputFileCommand.Options
def getOptions: (OParser[Unit, Options], Options) = {
import builder.*
cmd(name).children(
arg[File]("input-file").action((f, opt) => opt.copy(command = name, inputFile = Some(f.toPath)))
) -> InputFileCommandPlugin.Options()
) -> InputFileCommand.Options()
}

override def getConfigReader: ConfigReader[Options] = { (cur: ConfigCursor) =>
Expand Down

0 comments on commit 37a0a98

Please sign in to comment.