From: jsancho Date: Sun, 10 Jul 2011 09:23:27 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=70e0a8eeafcf4beee40306b3a3e6c0bc4fafd7bc;p=gacela.git --- diff --git a/src/gacela.c b/src/gacela.c index 8c36b4e..3262aee 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -229,16 +229,22 @@ start_client (char *hostname, int port) int main (int argc, char *argv[]) { - int shell_mode = 0; - int port; + char *arg; + int mode = 0; // shell: 1, server: 2, client: 3 + int port = 2; int i; for (i = 1; i < argc; i++) if (strcmp (argv[i], "--shell-mode") == 0) - shell_mode = 1; + mode = 1; + else if (strncmp (argv[i], "--server", 8) == 0) { + arg = strdup (argv[i]); + port = 1234; - if (shell_mode == 1) + if (mode == 1) start_single (dirname (argv[0])); + else + printf ("Puerto: %d\n", port); /* if (fork () == 0) start_server ();