Skip to content

Commit

Permalink
#320 Script storage option (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
DieMyst authored Nov 5, 2021
1 parent 0eab86d commit 3665abe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cli/src/main/scala/aqua/AppOpts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ object AppOpts {
.map(_ => true)
.withDefault(false)

val scriptOpt: Opts[Boolean] =
Opts
.flag("scheduled", "Generate air code for script storage. Without error handling wrappers and hops on relay. Will ignore other options")
.map(_ => true)
.withDefault(false)

lazy val versionStr: String =
Version.version

Expand Down
9 changes: 7 additions & 2 deletions cli/src/main/scala/aqua/AquaCli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,20 @@ object AquaCli extends IOApp with Logging {
wrapWithOption(versionOpt),
logLevelOpt,
constantOpts[Id],
dryOpt
dryOpt,
scriptOpt
).mapN {
case (inputF, importsF, outputF, toAir, toJs, noRelay, noXor, h, v, logLevel, constants, isDryRun) =>
case (inputF, importsF, outputF, toAirOp, toJs, noRelayOp, noXorOp, h, v, logLevel, constants, isDryRun, isScheduled) =>
scribe.Logger.root
.clearHandlers()
.clearModifiers()
.withHandler(formatter = LogFormatter.formatter, minimumLevel = Some(logLevel))
.replace()

val toAir = toAirOp || isScheduled
val noXor = noXorOp || isScheduled
val noRelay = noRelayOp || isScheduled

// if there is `--help` or `--version` flag - show help and version
// otherwise continue program execution
h.map(_ => helpAndExit) orElse v.map(_ => versionAndExit) getOrElse {
Expand Down

0 comments on commit 3665abe

Please sign in to comment.