enable graphics by default unless --server
authorterom
Sun, 07 Dec 2008 22:15:21 +0000
changeset 267 2cb6f1421e45
parent 266 ad72d0a0cc02
child 268 0b96b88af335
enable graphics by default unless --server
src/Application.cc
--- a/src/Application.cc	Sun Dec 07 21:58:34 2008 +0000
+++ b/src/Application.cc	Sun Dec 07 22:15:21 2008 +0000
@@ -35,6 +35,9 @@
             arg_port = NETWORK_PORT_STR;
             arg_server = false;
             arg_connect = "";
+
+            // extra state
+            bool graphics_default = true;
             
             try {
                 // parse args
@@ -56,7 +59,6 @@
 
                     case 'c':
                         arg_connect = args.get_argument();
-                        arg_graphics = true;
                         break;
 
                     case 'g':
@@ -71,10 +73,14 @@
 
                 }
             }
-            
+
             // check for invalid combinations of arugments
             if (arg_server and !arg_connect.empty())
                 throw ArgumentError("cannot be both server and client");
+
+            // enable graphics by default unless server
+            if (!arg_server && graphics_default)
+                arg_graphics = true;
         }
 
     public: