Skip to content

Commit

Permalink
Use the command line name in the usage string
Browse files Browse the repository at this point in the history
  • Loading branch information
xrchz committed Nov 11, 2017
1 parent e150668 commit 5eb113c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions worker.sml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*)

val server = "https://cakeml.org/regression.cgi"
val usage_string = String.concat[
"worker [options]\n\n",
fun usage_string name = String.concat[
name, " [options]\n\n",
"Runs waiting jobs from ",server,"/\n\n",
"Summary of options:\n",
" --no-poll : Exit when no waiting jobs are found rather than polling.\n",
Expand Down Expand Up @@ -380,7 +380,7 @@ fun main () =
let
val args = CommandLine.arguments()
val () = if List.exists (fn a => a="--help" orelse a="-h" orelse a="-?") args
then (TextIO.output(TextIO.stdOut, usage_string); OS.Process.exit OS.Process.success)
then (TextIO.output(TextIO.stdOut, usage_string(CommandLine.name())); OS.Process.exit OS.Process.success)
else ()
val () = case get_int_arg "--error" args of NONE => ()
| SOME id => (
Expand Down

0 comments on commit 5eb113c

Please sign in to comment.