Skip to content

Commit 4d40aa9

Browse files
author
Tyler Burdsall
authored
Merge pull request #11 from iamtheburd/modify-json-output
Modify json output
2 parents d696562 + 5289145 commit 4d40aa9

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/cli_functions.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,24 @@ const void output_result(const vector<string> &result, const generation_args &ar
8989
{
9090
cout << "[\n";
9191
}
92-
json entry;
93-
for (unsigned long long j = 0; j < key_size; ++j)
92+
if (key_size == 0)
9493
{
95-
entry[args.pc.keys[j]] = result[j];
94+
json entry = json::array();
95+
for (const string& s : result)
96+
{
97+
entry.push_back(s);
98+
}
99+
cout << entry.dump(4);
100+
}
101+
else
102+
{
103+
json entry;
104+
for (unsigned long long j = 0; j < key_size; ++j)
105+
{
106+
entry[args.pc.keys[j]] = result[j];
107+
}
108+
cout << entry.dump(4);
96109
}
97-
cout << entry.dump(4);
98110
if (!for_optimization)
99111
{
100112
cout << "]\n";

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#define COMBIGEN_MAJOR_VERSION 1
2323
#define COMBIGEN_MINOR_VERSION 3
24-
#define COMBIGEN_REVISION_VERSION 1
24+
#define COMBIGEN_REVISION_VERSION 2
2525

2626
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
2727
#include "lib/win-getopt/getopt.h"

0 commit comments

Comments
 (0)