|
| 1 | +#ifdef HAS_READLINE |
1 | 2 | #include "riakc_console.hpp" |
| 3 | +#endif |
2 | 4 | #include <riak_client/cxx/riak_client.hpp> |
3 | 5 | #include <iostream> |
4 | 6 | #include <vector> |
@@ -32,6 +34,7 @@ riak::client_ptr make_client(string url_str) |
32 | 34 | return client; |
33 | 35 | } |
34 | 36 |
|
| 37 | +#ifdef HAS_READLINE |
35 | 38 | void info_command(riak_console& client, const riak::string_vector& tokens); |
36 | 39 | void list_command(riak_console& client, const riak::string_vector& tokens); |
37 | 40 | void get_command(riak_console& client, const riak::string_vector& tokens); |
@@ -137,6 +140,8 @@ void info_command(riak_console& client, const riak::string_vector& tokens) |
137 | 140 | print_server_info(client.client()); |
138 | 141 | } |
139 | 142 |
|
| 143 | +#endif |
| 144 | + |
140 | 145 | std::size_t parse_path_part(const std::string& path, std::string& part, std::size_t start) |
141 | 146 | { |
142 | 147 | if (path.empty()) return start; |
@@ -168,6 +173,8 @@ void print_server_info(riak::client_ptr client) |
168 | 173 | cout << "Server version: " << server_info.version() << endl; |
169 | 174 | } |
170 | 175 |
|
| 176 | + |
| 177 | + |
171 | 178 | void do_get(riak::client_ptr client) |
172 | 179 | { |
173 | 180 | riak::riak_bkey bkey(parse_path()); |
@@ -207,8 +214,12 @@ int main(int argc, char *argv[]) |
207 | 214 | } |
208 | 215 | if (command == "console") |
209 | 216 | { |
| 217 | +#ifdef HAS_READLINE |
210 | 218 | riak_console console(urlstr, make_client(urlstr)); |
211 | 219 | return console.run(); |
| 220 | +#else |
| 221 | + cout << "no readline support" << endl; |
| 222 | +#endif |
212 | 223 | } |
213 | 224 | riak::client_ptr client(make_client(urlstr)); |
214 | 225 | if (command == "server-info") |
|
0 commit comments