Skip to content
Snippets Groups Projects
Commit 8506a381 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

take socket name on command line
parent 7005dedd
No related branches found
No related tags found
No related merge requests found
...@@ -8,15 +8,9 @@ class GmshInteractiveClient{ ...@@ -8,15 +8,9 @@ class GmshInteractiveClient{
private: private:
GmshClient _client; GmshClient _client;
public: public:
GmshInteractiveClient() GmshInteractiveClient(char *socket)
{ {
using_history(); using_history();
char socket[256];
#if !defined(WIN32) || defined(__CYGWIN__)
sprintf(socket, "%s/.gmshsock", getenv("HOME"));
#else
sprintf(socket, "127.0.0.1:44122");
#endif
if(_client.Connect(socket) < 0) { if(_client.Connect(socket) < 0) {
printf("Unable to connect to Gmsh\n"); printf("Unable to connect to Gmsh\n");
exit(1); exit(1);
...@@ -81,9 +75,14 @@ class GmshInteractiveClient{ ...@@ -81,9 +75,14 @@ class GmshInteractiveClient{
} }
}; };
int main() int main(int argc, char **argv)
{ {
GmshInteractiveClient c; if(argc < 2){
printf("usage: %s socket\n", argv[0]);
exit(1);
}
GmshInteractiveClient c(argv[1]);
c.read("gmsh> "); c.read("gmsh> ");
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment