Skip to content

Commit f69fdc2

Browse files
grievejiafacebook-github-bot
authored andcommitted
Add new analyze command (1/4) -- skeleton
Reviewed By: dkgi Differential Revision: D30466706 fbshipit-source-id: feafc290262db64fae64ba2ef3344b95e646b24e
1 parent 8efbb4e commit f69fdc2

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

source/command/commands.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module BaseConfiguration = NewCommandStartup.BaseConfiguration
99
module Analyze = AnalyzeCommand
1010
module Check = CheckCommand
1111
module Infer = InferCommand
12+
module NewAnalyze = NewAnalyzeCommand
1213
module NewCheck = NewCheckCommand
1314
module NewInfer = NewInferCommand
1415
module NewServer = NewServerCommand
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*)
7+
8+
open Core
9+
10+
(* Analyze command uses the same exit code scheme as check command. *)
11+
module ExitStatus = NewCheckCommand.ExitStatus
12+
13+
let run_analyze _configuration_file =
14+
Log.warning "Coming soon...";
15+
let exit_status = ExitStatus.Ok in
16+
Statistics.flush ();
17+
exit (ExitStatus.exit_code exit_status)
18+
19+
20+
let command =
21+
let filename_argument = Command.Param.(anon ("filename" %: Filename.arg_type)) in
22+
Command.basic
23+
~summary:"Runs taint analysis"
24+
(Command.Param.map filename_argument ~f:(fun filename () -> run_analyze filename))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*)
7+
8+
open Core
9+
10+
val command : Command.t

source/main.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ let commands =
1414
"check", Check.check_command;
1515
"rage", Rage.command;
1616
"infer", Infer.infer_command;
17+
"newanalyze", NewAnalyze.command;
1718
"newcheck", NewCheck.command;
1819
"newinfer", NewInfer.command;
1920
"newserver", NewServer.command;

0 commit comments

Comments
 (0)