From 522471d7cb45058b2f2f7bc4dbc2e1f7da56b87a Mon Sep 17 00:00:00 2001 From: Fabrice Le Fessant Date: Tue, 17 Jan 2017 14:34:35 +0100 Subject: Allow plugins to declare new arguments with Clflags.add_arguments (#796) --- driver/main.ml | 5 +++-- driver/optmain.ml | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'driver') diff --git a/driver/main.ml b/driver/main.ml index 057d294838..7b918be8c5 100644 --- a/driver/main.ml +++ b/driver/main.ml @@ -126,9 +126,10 @@ module Options = Main_args.Make_bytecomp_options (struct end) let main () = + Clflags.add_arguments __LOC__ Options.list; try readenv ppf Before_args; - Arg.parse_expand Options.list anonymous usage; + Clflags.parse_arguments anonymous usage; begin try Compenv.process_deferred_actions (ppf, @@ -139,7 +140,7 @@ let main () = with Arg.Bad msg -> begin prerr_endline msg; - Arg.usage Options.list usage; + Clflags.print_arguments usage; exit 2 end end; diff --git a/driver/optmain.ml b/driver/optmain.ml index 5fd3d27755..be262f8028 100644 --- a/driver/optmain.ml +++ b/driver/optmain.ml @@ -236,8 +236,8 @@ let main () = let ppf = Format.err_formatter in try readenv ppf Before_args; - let spec = Arch.command_line_options @ Options.list in - Arg.parse_expand spec anonymous usage; + Clflags.add_arguments __LOC__ (Arch.command_line_options @ Options.list); + Clflags.parse_arguments anonymous usage; if !gprofile && not Config.profiling then fatal "Profiling with \"gprof\" is not supported on this platform."; begin try @@ -250,7 +250,7 @@ let main () = with Arg.Bad msg -> begin prerr_endline msg; - Arg.usage spec usage; + Clflags.print_arguments usage; exit 2 end end; -- cgit v1.2.1