@ -240,7 +240,7 @@ let real_exe_name =
let current_exe =
let current_exe =
if ! Sys . interactive then CLOpt . Interactive
if ! Sys . interactive then CLOpt . Interactive
else try IList . assoc String . equal ( Filename . basename real_exe_name ) CLOpt . exes
else try IList . assoc String . equal ( Filename . basename real_exe_name ) CLOpt . exes
with Not_found -> CLOpt . Toplevel
with Not_found -> CLOpt . Driver
let bin_dir =
let bin_dir =
Filename . dirname real_exe_name
Filename . dirname real_exe_name
@ -320,7 +320,7 @@ let inferconfig_home =
and project_root =
and project_root =
CLOpt . mk_path ~ deprecated : [ " project_root " ; " -project_root " ] ~ long : " project-root " ~ short : " pr "
CLOpt . mk_path ~ deprecated : [ " project_root " ; " -project_root " ] ~ long : " project-root " ~ short : " pr "
~ default : init_work_dir
~ default : init_work_dir
~ exes : CLOpt . [ Analyze ; Clang ; Print; Toplevel ]
~ exes : CLOpt . [ Analyze ; Clang ; Driver; Print ]
~ meta : " dir " " Specify the root directory of the project "
~ meta : " dir " " Specify the root directory of the project "
(* Parse the phase 1 options, ignoring the rest *)
(* Parse the phase 1 options, ignoring the rest *)
@ -405,7 +405,7 @@ and (
ignore (
ignore (
let long = " <analyzer>- " ^ suffix in
let long = " <analyzer>- " ^ suffix in
CLOpt . mk_string_list ~ long ~ meta ~ f : ( fun _ -> raise ( Arg . Bad " invalid option " ) )
CLOpt . mk_string_list ~ long ~ meta ~ f : ( fun _ -> raise ( Arg . Bad " invalid option " ) )
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
help
help
) ;
) ;
IList . map ( fun ( name , analyzer ) -> ( analyzer , mk_option name ) ) string_to_analyzer in
IList . map ( fun ( name , analyzer ) -> ( analyzer , mk_option name ) ) string_to_analyzer in
@ -445,7 +445,7 @@ and analyzer =
| Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters
| Capture | Compile | Infer | Eradicate | Checkers | Tracing | Crashcontext | Linters
| Quandary | Threadsafety -> () in
| Quandary | Threadsafety -> () in
CLOpt . mk_symbol_opt ~ deprecated : [ " analyzer " ] ~ long : " analyzer " ~ short : " a "
CLOpt . mk_symbol_opt ~ deprecated : [ " analyzer " ] ~ long : " analyzer " ~ short : " a "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Specify which analyzer to run (only one at a time is supported): \n \
" Specify which analyzer to run (only one at a time is supported): \n \
- infer , eradicate , checkers , quandary , threadsafety : run the specified analysis \ n \
- infer , eradicate , checkers , quandary , threadsafety : run the specified analysis \ n \
- capture : run capture phase only ( no analysis ) \ n \
- capture : run capture phase only ( no analysis ) \ n \
@ -475,13 +475,13 @@ and ast_file =
and blacklist =
and blacklist =
CLOpt . mk_string_opt ~ deprecated : [ " -blacklist-regex " ; " -blacklist " ] ~ long : " buck-blacklist "
CLOpt . mk_string_opt ~ deprecated : [ " -blacklist-regex " ; " -blacklist " ] ~ long : " buck-blacklist "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
~ meta : " regex " " Skip analysis of files matched by the specified regular expression (Buck \
~ meta : " regex " " Skip analysis of files matched by the specified regular expression (Buck \
flavors only ) "
flavors only ) "
and bootclasspath =
and bootclasspath =
CLOpt . mk_string_opt ~ long : " bootclasspath "
CLOpt . mk_string_opt ~ long : " bootclasspath "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Specify the Java bootclasspath "
" Specify the Java bootclasspath "
(* * Automatically set when running from within Buck *)
(* * Automatically set when running from within Buck *)
@ -491,49 +491,49 @@ and buck =
and buck_build_args =
and buck_build_args =
CLOpt . mk_string_list ~ long : " Xbuck "
CLOpt . mk_string_list ~ long : " Xbuck "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Pass values as command-line arguments to invocations of `buck build` (Buck flavors only) "
" Pass values as command-line arguments to invocations of `buck build` (Buck flavors only) "
and buck_out =
and buck_out =
CLOpt . mk_path_opt ~ long : " buck-out "
CLOpt . mk_path_opt ~ long : " buck-out "
~ exes : CLOpt . [ Toplevel ] ~ meta : " dir " " Specify the root directory of buck-out "
~ exes : CLOpt . [ Driver ] ~ meta : " dir " " Specify the root directory of buck-out "
and bugs_csv =
and bugs_csv =
CLOpt . mk_path_opt ~ deprecated : [ " bugs " ] ~ long : " issues-csv "
CLOpt . mk_path_opt ~ deprecated : [ " bugs " ] ~ long : " issues-csv "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
~ meta : " file " " Write a list of issues in CSV format to a file "
~ meta : " file " " Write a list of issues in CSV format to a file "
and bugs_json =
and bugs_json =
CLOpt . mk_path_opt ~ deprecated : [ " bugs_json " ] ~ long : " issues-json "
CLOpt . mk_path_opt ~ deprecated : [ " bugs_json " ] ~ long : " issues-json "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
~ meta : " file " " Write a list of issues in JSON format to a file "
~ meta : " file " " Write a list of issues in JSON format to a file "
and bugs_tests =
and bugs_tests =
CLOpt . mk_path_opt ~ long : " issues-tests "
CLOpt . mk_path_opt ~ long : " issues-tests "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
~ meta : " file "
~ meta : " file "
" Write a list of issues in a format suitable for tests to a file "
" Write a list of issues in a format suitable for tests to a file "
and bugs_txt =
and bugs_txt =
CLOpt . mk_path_opt ~ deprecated : [ " bugs_txt " ] ~ long : " issues-txt "
CLOpt . mk_path_opt ~ deprecated : [ " bugs_txt " ] ~ long : " issues-txt "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
~ meta : " file "
~ meta : " file "
" Write a list of issues in TXT format to a file "
" Write a list of issues in TXT format to a file "
and bugs_xml =
and bugs_xml =
CLOpt . mk_path_opt ~ deprecated : [ " bugs_xml " ] ~ long : " issues-xml "
CLOpt . mk_path_opt ~ deprecated : [ " bugs_xml " ] ~ long : " issues-xml "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
~ meta : " file "
~ meta : " file "
" Write a list of issues in XML format to a file "
" Write a list of issues in XML format to a file "
and calls_csv =
and calls_csv =
CLOpt . mk_path_opt ~ deprecated : [ " calls " ] ~ long : " calls-csv "
CLOpt . mk_path_opt ~ deprecated : [ " calls " ] ~ long : " calls-csv "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
~ meta : " file "
~ meta : " file "
" Write individual calls in CSV format to a file "
" Write individual calls in CSV format to a file "
and changed_files_index =
and changed_files_index =
CLOpt . mk_path_opt ~ long : " changed-files-index " ~ exes : CLOpt . [ Toplevel ] ~ meta : " file "
CLOpt . mk_path_opt ~ long : " changed-files-index " ~ exes : CLOpt . [ Driver ] ~ meta : " file "
" Specify the file containing the list of source files from which reactive analysis should \
" Specify the file containing the list of source files from which reactive analysis should \
start . Source files should be specified relative to project root or be absolute "
start . Source files should be specified relative to project root or be absolute "
@ -604,7 +604,7 @@ and cluster =
and compute_analytics =
and compute_analytics =
CLOpt . mk_bool ~ long : " compute-analytics "
CLOpt . mk_bool ~ long : " compute-analytics "
~ default : false
~ default : false
~ exes : CLOpt . [ Toplevel; Clang ]
~ exes : CLOpt . [ Clang; Driver ]
" Emit analytics as info-level issues, like component kit line count and \
" Emit analytics as info-level issues, like component kit line count and \
component kit file cyclomatic complexity "
component kit file cyclomatic complexity "
@ -612,7 +612,7 @@ and compute_analytics =
If a procedure was changed beforehand , keep the changed marking . * )
If a procedure was changed beforehand , keep the changed marking . * )
and continue =
and continue =
CLOpt . mk_bool ~ deprecated : [ " continue " ] ~ long : " continue "
CLOpt . mk_bool ~ deprecated : [ " continue " ] ~ long : " continue "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Continue the capture for the reactive analysis, increasing the changed files/procedures. (If \
" Continue the capture for the reactive analysis, increasing the changed files/procedures. (If \
a procedure was changed beforehand , keep the changed marking . ) "
a procedure was changed beforehand , keep the changed marking . ) "
@ -646,7 +646,7 @@ and (
and filtering =
and filtering =
CLOpt . mk_bool ~ long : " filtering " ~ short : " f " ~ default : true
CLOpt . mk_bool ~ long : " filtering " ~ short : " f " ~ default : true
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Do not show the results from experimental checks (note: some of them may contain many false \
" Do not show the results from experimental checks (note: some of them may contain many false \
alarms ) "
alarms ) "
@ -716,7 +716,7 @@ and dependencies =
and disable_checks =
and disable_checks =
CLOpt . mk_string_list ~ deprecated : [ " disable_checks " ] ~ long : " disable-checks " ~ meta : " error name "
CLOpt . mk_string_list ~ deprecated : [ " disable_checks " ] ~ long : " disable-checks " ~ meta : " error name "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Driver ; Print ]
" Do not show reports coming from this type of errors "
" Do not show reports coming from this type of errors "
and dotty_cfg_libs =
and dotty_cfg_libs =
@ -778,7 +778,7 @@ and err_file =
and fail_on_bug =
and fail_on_bug =
CLOpt . mk_bool ~ deprecated : [ " -fail-on-bug " ] ~ long : " fail-on-issue " ~ default : false
CLOpt . mk_bool ~ deprecated : [ " -fail-on-bug " ] ~ long : " fail-on-issue " ~ default : false
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
( Printf . sprintf " Exit with error code %d if Infer found something to report "
( Printf . sprintf " Exit with error code %d if Infer found something to report "
fail_on_issue_exit_code )
fail_on_issue_exit_code )
@ -800,7 +800,7 @@ and filter_paths =
and flavors =
and flavors =
CLOpt . mk_bool ~ deprecated : [ " -use-flavors " ] ~ long : " flavors "
CLOpt . mk_bool ~ deprecated : [ " -use-flavors " ] ~ long : " flavors "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Buck integration using Buck flavors (clang only), eg `infer --flavors -- buck build \
" Buck integration using Buck flavors (clang only), eg `infer --flavors -- buck build \
// foo : bar # infer ` "
// foo : bar # infer ` "
@ -827,7 +827,7 @@ and frontend_tests =
and generated_classes =
and generated_classes =
CLOpt . mk_path_opt ~ long : " generated-classes "
CLOpt . mk_path_opt ~ long : " generated-classes "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Specify where to load the generated class files "
" Specify where to load the generated class files "
and headers =
and headers =
@ -845,7 +845,7 @@ and infer_cache =
~ meta : " dir " " Select a directory to contain the infer cache (Buck and Java only) "
~ meta : " dir " " Select a directory to contain the infer cache (Buck and Java only) "
and iphoneos_target_sdk_version =
and iphoneos_target_sdk_version =
CLOpt . mk_string_opt ~ long : " iphoneos-target-sdk-version " ~ exes : CLOpt . [ Toplevel; Clang ]
CLOpt . mk_string_opt ~ long : " iphoneos-target-sdk-version " ~ exes : CLOpt . [ Clang; Driver ]
" Specify the target SDK version to use for iphoneos "
" Specify the target SDK version to use for iphoneos "
and iterations =
and iterations =
@ -861,7 +861,7 @@ and java_jar_compiler =
and jobs =
and jobs =
CLOpt . mk_int ~ deprecated : [ " -multicore " ] ~ long : " jobs " ~ short : " j " ~ default : ncpu
CLOpt . mk_int ~ deprecated : [ " -multicore " ] ~ long : " jobs " ~ short : " j " ~ default : ncpu
~ exes : CLOpt . [ Toplevel ] ~ meta : " int " " Run the specified number of analysis jobs simultaneously "
~ exes : CLOpt . [ Driver ] ~ meta : " int " " Run the specified number of analysis jobs simultaneously "
and join_cond =
and join_cond =
CLOpt . mk_int ~ deprecated : [ " join_cond " ] ~ long : " join-cond " ~ default : 1
CLOpt . mk_int ~ deprecated : [ " join_cond " ] ~ long : " join-cond " ~ default : 1
@ -881,7 +881,7 @@ and linters_def_file =
and load_average =
and load_average =
CLOpt . mk_float_opt ~ long : " load-average " ~ short : " l "
CLOpt . mk_float_opt ~ long : " load-average " ~ short : " l "
~ exes : CLOpt . [ Toplevel ] ~ meta : " float "
~ exes : CLOpt . [ Driver ] ~ meta : " float "
" Do not start new parallel jobs if the load average is greater than that specified (Buck and \
" Do not start new parallel jobs if the load average is greater than that specified (Buck and \
make only ) "
make only ) "
@ -901,7 +901,7 @@ and margin =
and merge =
and merge =
CLOpt . mk_bool ~ deprecated : [ " merge " ] ~ long : " merge "
CLOpt . mk_bool ~ deprecated : [ " merge " ] ~ long : " merge "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Merge the captured results directories specified in the dependency file (Buck flavors only) "
" Merge the captured results directories specified in the dependency file (Buck flavors only) "
and ml_buckets =
and ml_buckets =
@ -965,7 +965,7 @@ and patterns_skip_translation =
and pmd_xml =
and pmd_xml =
CLOpt . mk_bool ~ long : " pmd-xml "
CLOpt . mk_bool ~ long : " pmd-xml "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Output issues in (PMD) XML format "
" Output issues in (PMD) XML format "
and precondition_stats =
and precondition_stats =
@ -973,7 +973,7 @@ and precondition_stats =
" Print stats about preconditions to standard output "
" Print stats about preconditions to standard output "
and print_logs =
and print_logs =
CLOpt . mk_bool ~ long : " print-logs " ~ exes : CLOpt . [ Toplevel ]
CLOpt . mk_bool ~ long : " print-logs " ~ exes : CLOpt . [ Driver ]
" Also log messages to stdout and stderr "
" Also log messages to stdout and stderr "
and print_builtins =
and print_builtins =
@ -1001,7 +1001,7 @@ and procs_xml =
and progress_bar =
and progress_bar =
CLOpt . mk_bool ~ deprecated_no : [ " no_progress_bar " ] ~ long : " progress-bar " ~ short : " pb " ~ default : true
CLOpt . mk_bool ~ deprecated_no : [ " no_progress_bar " ] ~ long : " progress-bar " ~ short : " pb " ~ default : true
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Show a progress bar "
" Show a progress bar "
and quiet =
and quiet =
@ -1036,7 +1036,7 @@ and report_hook =
and results_dir =
and results_dir =
CLOpt . mk_path ~ deprecated : [ " results_dir " ; " -out " ] ~ long : " results-dir " ~ short : " o "
CLOpt . mk_path ~ deprecated : [ " results_dir " ; " -out " ] ~ long : " results-dir " ~ short : " o "
~ default : ( init_work_dir ^/ " infer-out " )
~ default : ( init_work_dir ^/ " infer-out " )
~ exes : CLOpt . [ Toplevel; Analyze; Clang ; Print ]
~ exes : CLOpt . [ Analyze; Clang ; Driver ; Print ]
~ meta : " dir " " Write results and internal files in the specified directory "
~ meta : " dir " " Write results and internal files in the specified directory "
and save_results =
and save_results =
@ -1104,13 +1104,13 @@ and specs_library =
specs_library
specs_library
and stacktrace =
and stacktrace =
CLOpt . mk_path_opt ~ long : " stacktrace " ~ short : " st " ~ exes : CLOpt . [ Toplevel ]
CLOpt . mk_path_opt ~ long : " stacktrace " ~ short : " st " ~ exes : CLOpt . [ Driver ]
~ meta : " file " " File path containing a json-encoded Java crash stacktrace. Used to guide the \
~ meta : " file " " File path containing a json-encoded Java crash stacktrace. Used to guide the \
analysis ( only with ' - a crashcontext' ) . See \
analysis ( only with ' - a crashcontext' ) . See \
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
and stacktraces_dir =
and stacktraces_dir =
CLOpt . mk_path_opt ~ long : " stacktraces-dir " ~ exes : CLOpt . [ Toplevel ]
CLOpt . mk_path_opt ~ long : " stacktraces-dir " ~ exes : CLOpt . [ Driver ]
~ meta : " dir " " Directory path containing multiple json-encoded Java crash stacktraces. \
~ meta : " dir " " Directory path containing multiple json-encoded Java crash stacktraces. \
Used to guide the analysis ( only with ' - a crashcontext' ) . See \
Used to guide the analysis ( only with ' - a crashcontext' ) . See \
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
@ -1177,7 +1177,7 @@ and verbose_out =
and version =
and version =
let var = ref ` None in
let var = ref ` None in
CLOpt . mk_set var ` Full ~ deprecated : [ " version " ] ~ long : " version "
CLOpt . mk_set var ` Full ~ deprecated : [ " version " ] ~ long : " version "
~ exes : CLOpt . [ Toplevel; Analyze; Clang ; Print ]
~ exes : CLOpt . [ Analyze; Clang ; Driver ; Print ]
" Print version information and exit " ;
" Print version information and exit " ;
CLOpt . mk_set var ` Json ~ deprecated : [ " version_json " ] ~ long : " version-json "
CLOpt . mk_set var ` Json ~ deprecated : [ " version_json " ] ~ long : " version-json "
~ exes : CLOpt . [ Analyze ; Clang ; Print ]
~ exes : CLOpt . [ Analyze ; Clang ; Print ]
@ -1207,13 +1207,13 @@ and worklist_mode =
and xcode_developer_dir =
and xcode_developer_dir =
CLOpt . mk_path_opt ~ long : " xcode-developer-dir "
CLOpt . mk_path_opt ~ long : " xcode-developer-dir "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
~ meta : " XCODE_DEVELOPER_DIR " " Specify the path to Xcode developer directory (Buck flavors only) "
~ meta : " XCODE_DEVELOPER_DIR " " Specify the path to Xcode developer directory (Buck flavors only) "
and xcpretty =
and xcpretty =
CLOpt . mk_bool ~ long : " xcpretty "
CLOpt . mk_bool ~ long : " xcpretty "
~ default : true
~ default : true
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Infer will use xcpretty together with xcodebuild to analyze an iOS app. xcpretty just needs \
" Infer will use xcpretty together with xcodebuild to analyze an iOS app. xcpretty just needs \
to be in the path , infer command is still just infer - - < xcodebuild command > . ( Recommended ) "
to be in the path , infer command is still just infer - - < xcodebuild command > . ( Recommended ) "
@ -1249,7 +1249,7 @@ let rest =
) in
) in
let version_spec = Arg . Unit ( fun () -> version := ` Javac ) in
let version_spec = Arg . Unit ( fun () -> version := ` Javac ) in
CLOpt . mk_subcommand
CLOpt . mk_subcommand
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Driver ]
" Stop argument processing, use remaining arguments as a build command "
" Stop argument processing, use remaining arguments as a build command "
( fun build_exe ->
( fun build_exe ->
match Filename . basename build_exe with
match Filename . basename build_exe with
@ -1282,7 +1282,7 @@ let exe_usage (exe : CLOpt.exe) =
To process all the . specs in the current directory , pass . as only parameter \
To process all the . specs in the current directory , pass . as only parameter \
To process all the . specs in the results directory , use option - - results - dir \
To process all the . specs in the results directory , use option - - results - dir \
Each spec is printed to standard output unless option - q is used . "
Each spec is printed to standard output unless option - q is used . "
| Toplevel ->
| Driver ->
version_string
version_string
let post_parsing_initialization () =
let post_parsing_initialization () =