#320 Script storage option (#355)

This commit is contained in:
Dima 2021-11-05 12:03:40 +03:00 committed by GitHub
parent 0eab86dc4c
commit 3665abe4b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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 {