Skip to content

Commit 6302bb2

Browse files
committed
fix gobview default path
1 parent b373d06 commit 6302bb2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

goblint-http-server/goblint_http.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ let docroot = ref "run"
99
let index = ref "index.html"
1010
let addr = ref "127.0.0.1"
1111
let port = ref 8080
12-
let goblint = ref "goblint"
12+
let goblint = ref "./goblint"
13+
let file_paths = ref []
1314
let rest = ref []
1415

1516
let specs =
@@ -22,8 +23,6 @@ let specs =
2223
("-goblint", Arg.Rest_all (fun args -> rest := args), "Pass the rest of the arguments to Goblint");
2324
]
2425

25-
let paths = ref []
26-
2726
let process state name body =
2827
match Hashtbl.find_option Api.registry name with
2928
| None -> Server.respond_not_found ()
@@ -146,7 +145,7 @@ let callback state _ req body =
146145
| _ -> Server.respond_not_found ()
147146

148147
let main () =
149-
let%lwt state = Goblint.spawn !goblint (!rest @ !paths) >|= State.make in
148+
let%lwt state = Goblint.spawn !goblint (!rest @ !file_paths) >|= State.make in
150149
(* run Goblint once with option gobview enabled to copy the index.html and main.js files into the served directory *)
151150
let%lwt _ = Goblint.analyze ~save_dir:!docroot ~gobview:true state.goblint in
152151
let callback = callback state in
@@ -155,6 +154,7 @@ let main () =
155154

156155
let () =
157156
let program = Sys.argv.(0) in
158-
let usage = Printf.sprintf "%s [-docroot DOCROOT] [-index INDEX] [-addr ADDR] [-port PORT] ... path [path ...]" program in
159-
Arg.parse specs (fun s -> paths := s :: !paths) usage;
157+
let usage = Printf.sprintf "Usage: %s [options] source-files\nLookup options using '%s --help'." program program in
158+
let anon_arg a = file_paths := a :: !file_paths; () in
159+
Arg.parse specs anon_arg usage;
160160
Lwt_main.run (main ())

0 commit comments

Comments
 (0)