mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 22:17:01 +08:00
[ground_segment] sane error when launching settings without specifying aircraft
This commit is contained in:
@@ -80,11 +80,20 @@ let _ =
|
||||
|
||||
let ivy_bus = ref Defivybus.default_ivy_bus in
|
||||
let acs = ref [] in
|
||||
Arg.parse
|
||||
|
||||
let anon_fun = (fun x -> prerr_endline ("WARNING: don't do anything with "^x)) in
|
||||
let speclist =
|
||||
[ "-b", Arg.String (fun x -> ivy_bus := x), (sprintf "<ivy bus> Default is %s" !ivy_bus);
|
||||
"-ac", Arg.String (fun x -> acs := x :: !acs), "A/C name"]
|
||||
(fun x -> prerr_endline ("WARNING: don't do anything with "^x))
|
||||
"Usage: ";
|
||||
and usage_msg = "Usage: " in
|
||||
|
||||
Arg.parse speclist anon_fun usage_msg;
|
||||
|
||||
if List.length !acs = 0 then begin
|
||||
prerr_endline "Error: Specify at least one Aircraft for which to display the settings!";
|
||||
Arg.usage speclist usage_msg;
|
||||
exit 1
|
||||
end;
|
||||
|
||||
(** Connect to the Ivy bus *)
|
||||
Ivy.init "Paparazzi settings" "READY" (fun _ _ -> ());
|
||||
|
||||
Reference in New Issue
Block a user