aboutsummaryrefslogtreecommitdiffstats
path: root/eval/src/apps/eval_expr/eval_expr.cpp
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2021-08-31 10:36:05 +0000
committerHåvard Pettersen <havardpe@oath.com>2021-08-31 10:36:05 +0000
commit220a9d181b85cb4c28148b45d485ee049ff1b8f0 (patch)
tree71c13e4bdc213f11d9a176eaf18c0e2a749151df /eval/src/apps/eval_expr/eval_expr.cpp
parent5b4b8cfc34e7a61971ef43d707446d16ff101d03 (diff)
minor fixes after review
Diffstat (limited to 'eval/src/apps/eval_expr/eval_expr.cpp')
-rw-r--r--eval/src/apps/eval_expr/eval_expr.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/eval/src/apps/eval_expr/eval_expr.cpp b/eval/src/apps/eval_expr/eval_expr.cpp
index a5dd5368d28..67eda68937a 100644
--- a/eval/src/apps/eval_expr/eval_expr.cpp
+++ b/eval/src/apps/eval_expr/eval_expr.cpp
@@ -27,7 +27,6 @@ using vespalib::slime::JsonFormat;
using vespalib::slime::Inspector;
using vespalib::slime::Cursor;
-
const auto &factory = FastValueBuilderFactory::get();
int usage(const char *self) {
@@ -39,7 +38,8 @@ int usage(const char *self) {
fprintf(stderr, " using single letter symbols ('a' through 'z'). Quote expressions to\n");
fprintf(stderr, " make sure they become separate parameters. The --verbose option may\n");
fprintf(stderr, " be specified to get more detailed informaion about how the various\n");
- fprintf(stderr, " expressions are optimized.\n\n");
+ fprintf(stderr, " expressions are optimized.\n");
+ fprintf(stderr, "\n");
fprintf(stderr, "example: %s \"2+2\" \"a+2\" \"a+b\"\n", self);
fprintf(stderr, " (a=4, b=6, c=10)\n");
fprintf(stderr, "\n");
@@ -62,12 +62,13 @@ int usage(const char *self) {
fprintf(stderr, " relevant command and will result in the 'steps' field being populated in\n");
fprintf(stderr, " the response.\n");
fprintf(stderr, " if any command fails, the response will be { error:string }\n");
+ fprintf(stderr, " commands may be batched using json arrays:\n");
+ fprintf(stderr, " [cmd1,cmd2,cmd3] -> [res1,res2,res3]\n");
fprintf(stderr, "\n");
// -------------------------------------------------------------------------------
return 1;
}
-
int overflow(int cnt, int max) {
fprintf(stderr, "error: too many expressions: %d (max is %d)\n", cnt, max);
return 2;
@@ -221,7 +222,7 @@ int interactive_mode(Context &ctx) {
if (is_only_whitespace(line)) {
continue;
}
- if (line.find(exit_cmd) == 0) {
+ if (line == exit_cmd) {
return 0;
}
if (line.find(verbose_cmd) == 0) {