File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1+ let tool_name = " api-diff"
2+
13let run (`Main_module main_module ) (`Ref_cmi reference ) (`Current_cmi current ) =
24 let open CCResult.Infix in
35 let * reference_sig, current_sig, module_name =
@@ -15,8 +17,8 @@ let run (`Main_module main_module) (`Ref_cmi reference) (`Current_cmi current) =
1517 | None -> ()
1618 | Some _ ->
1719 Printf. eprintf
18- " %s: --main-module ignored when diffing single .cmi files"
19- Sys. executable_name
20+ " %s: --main-module ignored when diffing single .cmi files\n "
21+ tool_name
2022 in
2123 let + reference_cmi, _ = Api_watch.Library. load_cmi reference
2224 and + current_cmi, module_name = Api_watch.Library. load_cmi current in
@@ -73,7 +75,7 @@ let current_cmi =
7375
7476let info =
7577 let open Cmdliner in
76- Cmd. info " api-watcher " ~version: " %%VERSION%%" ~exits: Cmd.Exit. defaults
78+ Cmd. info tool_name ~version: " %%VERSION%%" ~exits: Cmd.Exit. defaults
7779 ~doc: " List API changes between two versions of a library"
7880
7981let term = Cmdliner.Term. (const run $ main_module $ ref_cmi $ current_cmi)
Original file line number Diff line number Diff line change @@ -4,12 +4,21 @@ diff a .cmi file with another .cmi file or a directory with a directory
44 $ mkdir test
55 $ touch test. cmi
66 $ api-diff test test. cmi
7- api- watcher : Arguments must either both be directories or both single .cmi files.
7+ api-diff : Arguments must either both be directories or both single . cmi files.
88 [123 ]
99
1010When diffing all libraries, the -- main-module argument is mandatory
1111
1212 $ mkdir test2
1313 $ api-diff test test2
14- api- watcher: -- main-module must be provided when diffing entire libraries.
14+ api-diff: -- main-module must be provided when diffing entire libraries.
15+ [123 ]
16+
17+ When passing -- main-module while diffing single . cmi files, the user will be warn
18+ that it is ignored
19+
20+ $ touch test2. cmi
21+ $ api-diff -- main-module main test. cmi test2. cmi
22+ api-diff: -- main-module ignored when diffing single . cmi files
23+ api-diff: Cmi_format. Error(_)
1524 [123 ]
You can’t perform that action at this time.
0 commit comments