initialise app with a file path, for the functionality of loading different files from the terminal
This commit is contained in:
@@ -2,7 +2,7 @@ structure InitGlfw =
|
||||
struct
|
||||
open CML
|
||||
|
||||
fun init () =
|
||||
fun init path () =
|
||||
let
|
||||
(* Set up GLFW. *)
|
||||
val _ = Glfw.init ()
|
||||
@@ -20,6 +20,7 @@ struct
|
||||
, Constants.windowHeight
|
||||
, Constants.initialWidthClickPoints
|
||||
, Constants.initialHeightClickPoints
|
||||
, path
|
||||
)
|
||||
|
||||
val graphLines = GraphLines.generate initialModel
|
||||
@@ -59,6 +60,6 @@ struct
|
||||
()
|
||||
end
|
||||
|
||||
fun main () =
|
||||
(RunCML.doit (init, NONE); ())
|
||||
fun main path =
|
||||
(RunCML.doit (init path, NONE); ())
|
||||
end
|
||||
|
||||
@@ -3,7 +3,8 @@ struct
|
||||
fun main () =
|
||||
case CommandLine.arguments () of
|
||||
["-r"] => Converter.main ()
|
||||
| [] => InitGlfw.main ()
|
||||
| [filename] => InitGlfw.main filename
|
||||
| [] => print "error: no arguments\n"
|
||||
| args =>
|
||||
let
|
||||
val args = String.concatWith "" args
|
||||
|
||||
Reference in New Issue
Block a user