From 62853bbd729ec35d9e9fc2cf0b26be454641401d Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 1 Sep 2017 07:34:19 -0700 Subject: [PATCH] [config] make ---only actually work Summary: shamecube Reviewed By: sblackshear Differential Revision: D5754580 fbshipit-source-id: 1f8c770 --- infer/src/base/Config.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 1445ba1a1..2453c2bf9 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -660,8 +660,12 @@ and ( annotation_reachability let _ : bool ref = CLOpt.mk_bool_group ~long:(long ^ "-only") ~in_help:CLOpt.([(Analyze, manual_generic)]) - (Printf.sprintf "Enable $(b,--%s) and disable all other checkers" long) [var] - (List.map ~f:fst !all_checkers) + (Printf.sprintf "Enable $(b,--%s) and disable all other checkers" long) + [(* enable this checker *) var] + ((* disable all checkers except this one *) + List.filter_map + ~f:(fun (var', long') -> if String.equal long long' then None else Some var') + !all_checkers) in () in