|
15 | 15 | -- of the license. -- |
16 | 16 | ------------------------------------------------------------------------------ |
17 | 17 |
|
| 18 | +with Ada.Characters.Latin_1; |
18 | 19 | with Ada.Command_Line; |
19 | 20 | with Ada.Directories; |
20 | 21 | with Ada.Strings.Unbounded; |
@@ -47,13 +48,30 @@ procedure Tester.Run is |
47 | 48 | File : constant VSS.Command_Line.Positional_Option := |
48 | 49 | (Name => "test.json", |
49 | 50 | Description => "JSON test script"); |
| 51 | + |
| 52 | + Output_Format : constant VSS.Command_Line.Value_Option := |
| 53 | + (Short_Name => "", |
| 54 | + Long_Name => "output-format", |
| 55 | + Value_Name => "output_format_option", |
| 56 | + Description => |
| 57 | + VSS.Strings.Conversions.To_Virtual_String |
| 58 | + ("[diff | recent | verbose | min_diff]" |
| 59 | + & Ada.Characters.Latin_1.LF |
| 60 | + & "diff: diff computed on the fly (default)" |
| 61 | + & Ada.Characters.Latin_1.LF |
| 62 | + & "recent: recent output from the server" |
| 63 | + & Ada.Characters.Latin_1.LF |
| 64 | + & "verbose: full output from the server" |
| 65 | + & Ada.Characters.Latin_1.LF |
| 66 | + & "min_diff: only show the different values")); |
50 | 67 | end Options; |
51 | 68 |
|
52 | 69 | JSON : GNATCOLL.JSON.JSON_Value; |
53 | 70 | begin |
54 | 71 | VSS.Command_Line.Add_Option (Options.Debug); |
55 | 72 | VSS.Command_Line.Add_Option (Options.On_Hang); |
56 | 73 | VSS.Command_Line.Add_Option (Options.File); |
| 74 | + VSS.Command_Line.Add_Option (Options.Output_Format); |
57 | 75 | VSS.Command_Line.Process; -- This terminates process on option's error |
58 | 76 |
|
59 | 77 | if not Options.File.Is_Specified then |
@@ -104,10 +122,11 @@ begin |
104 | 122 | Test : Tester.Tests.Test; |
105 | 123 | begin |
106 | 124 | Test.Run |
107 | | - (Commands => JSON.Get, |
108 | | - File => Options.File.Value, |
109 | | - On_Hang => Options.On_Hang.Value, |
110 | | - Debug => Options.Debug.Is_Specified); |
| 125 | + (Commands => JSON.Get, |
| 126 | + File => Options.File.Value, |
| 127 | + On_Hang => Options.On_Hang.Value, |
| 128 | + Debug => Options.Debug.Is_Specified, |
| 129 | + Output_Format => Options.Output_Format.Value); |
111 | 130 | end; |
112 | 131 | end; |
113 | 132 | end Tester.Run; |
0 commit comments