File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3682,7 +3682,7 @@ void StartClient() {
36823682void StartNsClient () {
36833683 std::string endpoint;
36843684 std::string real_endpoint;
3685- if (FLAGS_interactive ) {
3685+ if (FLAGS_cmd. empty () ) {
36863686 std::cout << " Welcome to openmldb with version " << OPENMLDB_VERSION << std::endl;
36873687 }
36883688 std::shared_ptr<::openmldb::zk::ZkClient> zk_client;
@@ -3746,8 +3746,12 @@ void StartNsClient() {
37463746 std::string buffer;
37473747 display_prefix = endpoint + " " + client.GetDb () + " > " ;
37483748 multi_line_perfix = std::string (display_prefix.length () - 3 , ' ' ) + " -> " ;
3749- if (!FLAGS_interactive ) {
3749+ if (!FLAGS_cmd. empty () ) {
37503750 buffer = FLAGS_cmd;
3751+ if (!FLAGS_database.empty ()) {
3752+ std::string error;
3753+ client.Use (FLAGS_database, error);
3754+ }
37513755 } else {
37523756 char * line = ::openmldb::base::linenoise (multi_line ? multi_line_perfix.c_str () : display_prefix.c_str ());
37533757 if (line == NULL ) {
You can’t perform that action at this time.
0 commit comments