diff options
author | Fabrice Le Fessant <fabrice@lefessant.net> | 2017-01-17 14:34:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-17 14:34:35 +0100 |
commit | 522471d7cb45058b2f2f7bc4dbc2e1f7da56b87a (patch) | |
tree | ee78bc35a656c4329034949aca859840158f63bb /driver | |
parent | a15ed28927b27072d6afee043971bc6f22d6130a (diff) | |
download | ocaml-522471d7cb45058b2f2f7bc4dbc2e1f7da56b87a.tar.gz |
Allow plugins to declare new arguments with Clflags.add_arguments (#796)
Diffstat (limited to 'driver')
-rw-r--r-- | driver/main.ml | 5 | ||||
-rw-r--r-- | driver/optmain.ml | 6 |
2 files changed, 6 insertions, 5 deletions
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; |