Skip to content

Commit

Permalink
offline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyline300 committed Nov 9, 2024
1 parent 3fc2b36 commit a1c34be
Show file tree
Hide file tree
Showing 2 changed files with 5,978 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/scala/com/skyline/warlangmod/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ object Main extends CommandApp(
val defaultInFile = "src/units.csv"
val defaultOriginalFile = "src/unitsN.csv"
val defaultOutFile = "src/output.csv"

val localOperation = Opts.flag("Local",
help = "Use a local instance of your files"
).orFalse
val originalFile = Opts.option[String](
long = "original",
short = "r",
Expand All @@ -26,8 +30,14 @@ object Main extends CommandApp(
short = "o",
help = s"The output file to be written to, defaults $defaultOutFile when not provided").withDefault(defaultOutFile)

(inFile, originalFile, outFile).mapN {
(inputFileName, originalFileName, outputFileName) => App.runOffline(inputFileName, originalFileName, outputFileName)
(localOperation, inFile, originalFile, outFile).mapN {
(localOps, inputFileName, originalFileName, outputFileName) =>
if (localOps) {
println("-----Running Locally----")
App.runOffline(inputFileName, originalFileName, outputFileName)
} else println("running online")
}


}
)
Loading

0 comments on commit a1c34be

Please sign in to comment.