From 69f8140655fe112919d1df628ec1f1ecbac483fd Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Thu, 19 Jan 2017 03:54:25 -0800 Subject: [PATCH] [cli] do not accept unknown arguments in OCaml Summary: Checked manually that Config.ml covers all the options declared in Python: `cd ~/infer && git grep --color -nH -e 'add_argument'` Reviewed By: jeremydubreil Differential Revision: D4430402 fbshipit-source-id: e4c8614 --- infer/lib/python/inferlib/capture/buck.py | 6 ------ infer/src/base/Config.ml | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/infer/lib/python/inferlib/capture/buck.py b/infer/lib/python/inferlib/capture/buck.py index d7d12a6f9..5c6b13ce1 100644 --- a/infer/lib/python/inferlib/capture/buck.py +++ b/infer/lib/python/inferlib/capture/buck.py @@ -46,8 +46,6 @@ def create_argparser(group_name=MODULE_NAME): '{grp} module'.format(grp=MODULE_NAME), description=MODULE_DESCRIPTION, ) - group.add_argument('--print-harness', action='store_true', - help='Print generated harness code (Android only)') group.add_argument('--use-flavors', action='store_true', help='Run Infer analysis through the use of flavors. ' 'Currently this is supported only for the cxx_* ' @@ -67,10 +65,6 @@ def create_argparser(group_name=MODULE_NAME): group.add_argument('--blacklist-regex', help='Specify the regex for files to skip during ' 'the analysis (requires --use-flavors to work)') - group.add_argument('--merge-deps-files', action='store_true', - help='Merge the infer-deps.txt files generated by Buck ' - 'during the analysis (requires --use-flavors to ' - 'work)') group.add_argument('--Xbuck', action='append', default=[], type=string_in_quotes, help='Pass values as command-line arguments to ' diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 06db4ab51..57348d97e 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1006,7 +1006,7 @@ and quiet = "Do not print specs on standard output" and reactive = - CLOpt.mk_bool ~deprecated:["reactive"] ~long:"reactive" + CLOpt.mk_bool ~deprecated:["reactive"] ~long:"reactive" ~short:"r" "Reactive mode: the analysis starts from the files captured since the `infer` command started" and reactive_capture = @@ -1161,7 +1161,7 @@ and unsafe_malloc = "Assume that malloc(3) never returns null." and use_compilation_database = - CLOpt.mk_symbol_opt ~long:"use-compilation-database" + CLOpt.mk_symbol_opt ~long:"compilation-database" ~deprecated:["-use-compilation-database"] "Buck integration using the compilation database, with or without dependencies." ~symbols:[("deps", `Deps); ("no-deps", `NoDeps)] @@ -1346,7 +1346,7 @@ let post_parsing_initialization () = let parse_args_and_return_usage_exit = let usage_exit = - CLOpt.parse ~accept_unknown:true ~config_file:inferconfig_path current_exe exe_usage in + CLOpt.parse ~config_file:inferconfig_path current_exe exe_usage in post_parsing_initialization () ; usage_exit