diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp
index f27a7184742ced56f1e900a0afbba4f86446fadd..e718d900b2e127b236ee425a0ef801b0f8035b39 100644
--- a/Common/CommandLine.cpp
+++ b/Common/CommandLine.cpp
@@ -151,6 +151,10 @@ void GetOptions(int argc, char *argv[])
           Msg::InitializeOnelab(argv[i], argv[i + 1]);
           i += 2;
         }
+        else if(argv[i]){
+          Msg::InitializeOnelab(argv[i], "");
+          i += 1;
+        }
         else
           Msg::Fatal("Missing client name and/or address of OneLab server");
       }
diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index 0de083e5fe70c91e4dfe1ccd3961165a168c01af..c3485057d9bfab6d911632e5b57a73fe8c0759ef 100644
--- a/Common/GmshMessage.cpp
+++ b/Common/GmshMessage.cpp
@@ -635,8 +635,10 @@ void Msg::InitializeOnelab(const std::string &name, const std::string &sockname)
 {
 #if defined(HAVE_ONELAB)
   if(_onelabClient) delete _onelabClient;
-  if(sockname.empty())
-    _onelabClient = new onelab::localClient(name);
+  if(sockname.empty()){
+    _onelabClient = new onelab::localClient("Gmsh");
+    _onelabClient->fromFile(name);
+  }
   else{
     onelab::remoteNetworkClient *c = new onelab::remoteNetworkClient(name, sockname);
     _onelabClient = c;
@@ -661,7 +663,6 @@ void Msg::InitializeOnelab(const std::string &name, const std::string &sockname)
       //Info("Performing OneLab '%s'", ps[0].getValue().c_str());
       if(ps[0].getValue() == "initialize") Exit(0);
     }
-
   }
 #endif
 }