1515
1616class App implements Runnable {
1717
18- @ Option (names = { "-h" , "--help" }, usageHelp = true , description = "Show this help message and exit." )
19- boolean usageHelpRequested ;
20-
21- @ Option (names = { "-V" , "--version" }, versionHelp = true , description = "Print version information and exit." )
22- boolean versionInfoRequested ;
18+ // @Option(names = { "-h", "--help" }, usageHelp = true, description = "Show this help message and exit.")
19+ // boolean usageHelpRequested;
20+ //
21+ // @Option(names = { "-V", "--version" }, versionHelp = true, description = "Print version information and exit.")
22+ // boolean versionInfoRequested;
2323
2424 @ Option (names = { "-f" , "--format " }, paramLabel = "format" ,
2525 description = "output format [default: stylish]" , defaultValue = "stylish" )
@@ -35,11 +35,8 @@ class App implements Runnable {
3535 @ Override
3636 public void run () {
3737 try {
38- Map <String , Object > data1 = JsonParser .readJsonFile (filepath1 );
39- Map <String , Object > data2 = JsonParser .readJsonFile (filepath2 );
40-
41- System .out .println ("Файл 1: " + data1 );
42- System .out .println ("Файл 2: " + data2 );
38+ String diff = Differ .generate (filepath1 , filepath2 );
39+ System .out .println (diff );
4340 } catch (IOException e ) {
4441 System .err .println ("Ошибка при чтении файла: " + e .getMessage ());
4542 }
@@ -48,12 +45,4 @@ public void run() {
4845 public static void main (String [] args ) {
4946 new CommandLine (new App ()).execute (args );
5047 }
51-
52- public class JsonParser {
53- public static Map <String , Object > readJsonFile (String filePath ) throws IOException {
54- ObjectMapper objectMapper = new ObjectMapper ();
55- return objectMapper .readValue (new File ("src/main/resources/" + filePath ), Map .class );
56- }
57- }
5848}
59-
0 commit comments