Skip to content
Snippets Groups Projects
Commit bbd5d2db authored by Hans-Peter Deifel's avatar Hans-Peter Deifel :turtle: Committed by Hans-Peter Deifel
Browse files

Fix command line argument check in debugger

Also shows the correct binary name in the usage output.
parent 3a374ca4
No related branches found
No related tags found
No related merge requests found
......@@ -20,11 +20,11 @@ let nomTable name =
let _ = Gc.set { (Gc.get()) with Gc.minor_heap_size = 4194304; major_heap_increment = 67108864; space_overhead = 120 }
let printUsage () =
print_endline "Usage: \"debugger <functor> <formula>\" where";
let printUsage name =
print_endline ("Usage: \"" ^ name ^ " <functor> <formula>\" where");
print_endline "";
print_endline "Examples:";
print_endline "./debugger.native '(Const a b) * (Const c) * (Const d)' '( [pi1] =a <=> [pi2][pi1] =c) & ([pi1] =b <=> [pi2][pi2] =d)'";
print_endline (name ^ " '(Const a b) * (Const c) * (Const d)' '( [pi1] =a <=> [pi2][pi1] =c) & ([pi1] =b <=> [pi2][pi2] =d)'");
exit 1
let printResult () =
......@@ -90,7 +90,7 @@ let showNode = function
| [] -> print_endline "Error: number required!"
let _ =
if Array.length Sys.argv < 2 then printUsage()
if Array.length Sys.argv < 3 then printUsage Sys.argv.(0)
else
let formula = Sys.argv.(2) in
let sorts = (FE.sortTableFromString Sys.argv.(1)) in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment