diff --git a/sw/ground_segment/tmtc/settings.ml b/sw/ground_segment/tmtc/settings.ml index 48afb18dc7..2fb7dd6f83 100644 --- a/sw/ground_segment/tmtc/settings.ml +++ b/sw/ground_segment/tmtc/settings.ml @@ -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 " 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 _ _ -> ());