Skip to content

Commit

Permalink
Tweak CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Jul 4, 2022
1 parent 9a06c01 commit 4c0e2d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ trait Cli extends SbtModule with NativeImage with SnailgunPublishModule {
def ivyDeps = super.ivyDeps() ++ Seq(
ivy"com.github.alexarchambault::case-app:2.1.0-M14"
)
def mainClass = Some("snailgun.Cli")
def mainClass = Some("snailgun.Snailgun")

def nativeImageClassPath = runClasspath()
def nativeImageMainClass = mainClass().getOrElse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import java.io.{InputStream, PrintStream}
import java.net.ConnectException
import java.util.concurrent.atomic.AtomicBoolean

object Cli extends CaseApp[CliOptions] {
object Snailgun extends CaseApp[SnailgunOptions] {
override def stopAtFirstUnrecognized = true
def run(options: CliOptions, args: RemainingArgs): Unit = {
def run(options: SnailgunOptions, args: RemainingArgs): Unit = {
val inOpt = if (options.hasInput) Some(System.in) else None
val out = System.out
val err = System.err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import caseapp._

// format: off
@ArgsName("The command and arguments for the Nailgun server")
final case class CliOptions(
final case class SnailgunOptions(
@HelpMessage("Specify the host name of the target Nailgun server")
nailgunServer: Option[String] = None,
@HelpMessage("Specify the port of the target Nailgun server")
Expand All @@ -18,7 +18,7 @@ final case class CliOptions(
)
// format: on

object CliOptions {
implicit lazy val parser: Parser[CliOptions] = Parser.derive
implicit lazy val help: Help[CliOptions] = Help.derive
object SnailgunOptions {
implicit lazy val parser: Parser[SnailgunOptions] = Parser.derive
implicit lazy val help: Help[SnailgunOptions] = Help.derive
}

0 comments on commit 4c0e2d0

Please sign in to comment.