diff --git a/cli360monitoring/lib/statistics.py b/cli360monitoring/lib/statistics.py index 1203758..7b34b61 100644 --- a/cli360monitoring/lib/statistics.py +++ b/cli360monitoring/lib/statistics.py @@ -100,3 +100,5 @@ def print(self, format: str = 'table'): print(self.table) elif (format == 'csv'): print(self.table.get_csv_string(delimiter=self.config.delimiter)) + elif (format == 'json'): + print(self.table.get_json_string(header=False)) diff --git a/cli360monitoring/monitoring.py b/cli360monitoring/monitoring.py index 825c86f..6538b04 100755 --- a/cli360monitoring/monitoring.py +++ b/cli360monitoring/monitoring.py @@ -736,6 +736,7 @@ def performCLI(): cli_statistics.add_argument('--output', choices=['csv', 'table'], default='table', help='output format for the data') cli_statistics.add_argument('--csv', action='store_const', const='csv', dest='output', help='print data in CSV format') cli_statistics.add_argument('--table', action='store_const', const='table', dest='output', help='print data as ASCII table') + cli_statistics.add_argument('--json', action='store_const', const='json', dest='output', help='print data as JSON') # user tokens