@@ -4,9 +4,7 @@ let signFile s = s
44type cliCommand = Add of string | Clean | NoOp | Rm of string list
55
66let cli () =
7- let bsVersion = ref None in
87 let cliCommand = ref NoOp in
9- let setBsVersion s = bsVersion := Some s in
108 let usage = " genType version " ^ version in
119 let versionAndExit () =
1210 print_endline usage;
@@ -23,7 +21,6 @@ let cli () =
2321 and setClean () = Clean |> setCliCommand
2422 and speclist =
2523 [
26- (" -bs-version" , Arg. String setBsVersion, " set the bucklescript version" );
2724 (" -clean" , Arg. Unit setClean, " clean all the generated files" );
2825 (" -cmt-add" , Arg. String setAdd, " compile a .cmt[i] file" );
2926 ( " -cmt-rm" ,
@@ -33,7 +30,7 @@ let cli () =
3330 (" --version" , Arg. Unit versionAndExit, " show version information and exit" );
3431 ]
3532 in
36- let executeCliCommand ~ bsVersion cliCommand =
33+ let executeCliCommand cliCommand =
3734 match cliCommand with
3835 | Add s ->
3936 Log_.Color. forceColor := true ;
@@ -45,14 +42,12 @@ let cli () =
4542 (cmt, mlast)
4643 | _ -> assert false
4744 in
48- let config =
49- Paths. readConfig ~bs Version ~namespace: (cmt |> Paths. findNameSpace)
50- in
45+ let config = Paths. readConfig ~namespace: (cmt |> Paths. findNameSpace) in
5146 if ! Debug. basic then Log_. item " Add %s %s\n " cmt mlast;
5247 cmt |> GenTypeMain. processCmtFile ~sign File ~config ;
5348 exit 0
5449 | Clean ->
55- let config = Paths. readConfig ~bs Version ~ namespace:None in
50+ let config = Paths. readConfig ~namespace: None in
5651 let sourceDirs = ModuleResolver. readSourceDirs ~config in
5752 if ! Debug. basic then
5853 Log_. item " Clean %d dirs\n " (sourceDirs.dirs |> List. length);
@@ -83,7 +78,7 @@ let cli () =
8378 (* somehow the CMT hook is passing an absolute path here *)
8479 let cmt = cmtAbsolutePath |> Paths. relativePathFromBsLib in
8580 let config =
86- Paths. readConfig ~bs Version ~ namespace: (cmt |> Paths. findNameSpace)
81+ Paths. readConfig ~namespace: (cmt |> Paths. findNameSpace)
8782 in
8883 let outputFile = cmt |> Paths. getOutputFile ~config in
8984 if ! Debug. basic then Log_. item " Remove %s\n " cmt;
@@ -98,7 +93,7 @@ let cli () =
9893 | _ -> print_endline s
9994 in
10095 Arg. parse speclist anonArg usage;
101- executeCliCommand ~bs Version: ! bsVersion ! cliCommand
96+ executeCliCommand ! cliCommand
10297;;
10398
10499cli ()
0 commit comments