Skip to content

Commit

Permalink
fix(xcp_service.configure): do not fail on --help
Browse files Browse the repository at this point in the history
Fixes: 1d42c05 ("test(xapi_globs): add a unit test that xapi globs parsing works")

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Oct 2, 2024
1 parent 522c64b commit 98139be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ocaml/xapi-idl/lib/xcp_service.ml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,10 @@ let configure ?(argv = Sys.argv) ?(options = []) ?(resources = []) () =
(fun _ -> failwith "Invalid argument")
(Printf.sprintf "Usage: %s [-config filename]" Sys.argv.(0))
)
with Failure msg -> prerr_endline msg ; flush stderr ; exit 1
with
| Failure msg -> prerr_endline msg ; flush stderr ; exit 1
| Arg.Bad msg -> Printf.eprintf "%s" msg; exit 2
| Arg.Help msg -> Printf.printf "%s" msg; exit 0

let configure2 ~name ~version ~doc ?(options = []) ?(resources = []) () =
configure_common ~options ~resources @@ fun config_spec ->
Expand Down

0 comments on commit 98139be

Please sign in to comment.