"-e", Arg.Unit (set_mode `Edit), " Edit and upload the script";
"--edit", Arg.Unit (set_mode `Edit), " Edit and upload the script";
"--get", Arg.Unit (set_mode `Get), "var Display the variable";
+ "--job-names", Arg.Unit (set_mode `JobNames), " List names of loaded jobs";
"--jobs", Arg.Unit (set_mode `Jobs), " List running jobs";
"-l", Arg.Unit (set_mode `List), " List the script";
"--list", Arg.Unit (set_mode `List), " List the script";
);
tail arg1
+ | Some `JobNames ->
+ unused_error args "--job-names";
+ job_names ()
+
and edit_file () =
(* If there is no initial file, create an empty one containing the
* tutorial.
(Filename.quote job.Whenproto_aux.job_tmpdir) in
exit (Sys.command cmd)
+and job_names () =
+ let client = start_client () in
+ let names = Whenproto_clnt.When.V1.get_job_names client () in
+ stop_client client;
+ Array.iter print_endline names
+
and unused_error args op =
if args <> [] then (
eprintf "whenjobs %s: unused parameters on the command line.\n" op;