X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=tools%2Fwhenjobs.ml;h=582f259921490c244842cec84ce104c9eaba1240;hp=cfef9d6471123975ee0759f511a6f37dc3cebc35;hb=cdfbf1623f1d81cfca15f8efbe2bf444e6b1ef5a;hpb=8ee4056bf819402aa4225e73bbe0a66e24294581 diff --git a/tools/whenjobs.ml b/tools/whenjobs.ml index cfef9d6..582f259 100644 --- a/tools/whenjobs.ml +++ b/tools/whenjobs.ml @@ -102,6 +102,7 @@ let rec main () = "-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"; @@ -245,6 +246,10 @@ Options: ); 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. @@ -447,6 +452,12 @@ and tail serial = (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;