From 472184ba2de606ec8dd5cd11fbb158f82cf098a8 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 31 Oct 2017 07:44:44 +0100 Subject: [PATCH] return value from sequence of query commands --- aql2/src/aql.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aql2/src/aql.cpp b/aql2/src/aql.cpp index 1b7403027f..2b697ea38f 100644 --- a/aql2/src/aql.cpp +++ b/aql2/src/aql.cpp @@ -88,10 +88,14 @@ int main ( int argc, char * argv[] ) { if ( queries.getValue ( ).empty ( ) ) { result = p.run ( ); } else { - for ( const std::string & query : queries.getValue ( ) ) - p.execute_line ( query ); - - result = cli::Command::Result::QUIT; + for ( const std::string & query : queries.getValue ( ) ) { + result = p.execute_line ( query ); + if ( result != cli::Command::Result::OK ) + break; + } + + if ( result == cli::Command::Result::OK ) + result = cli::Command::Result::QUIT; } measurements::end ( ); -- GitLab