Subversion Repositories tpanel

Rev

Rev 247 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 247 Rev 251
Line 264... Line 264...
264
    string configFile;
264
    string configFile;
265
    int oldArgc = argc;
265
    int oldArgc = argc;
266
#if not defined(Q_OS_ANDROID) && not defined(Q_OS_IOS)
266
#if not defined(Q_OS_ANDROID) && not defined(Q_OS_IOS)
267
    string pname = *argv;
267
    string pname = *argv;
268
    size_t pos = pname.find_last_of("/");
268
    size_t pos = pname.find_last_of("/");
-
 
269
    bool haveParameters = (argc > 1);
269
 
270
 
270
    if (pos != string::npos)
271
    if (pos != string::npos)
271
        pname = pname.substr(pos + 1);
272
        pname = pname.substr(pos + 1);
272
#else
273
#else
273
    string pname = "tpanel";
274
    string pname = "tpanel";
274
    killed = false;
275
    killed = false;
275
    _netRunning = false;
276
    _netRunning = false;
-
 
277
    bool haveParameters = false;
276
#endif
278
#endif
277
    TConfig::setProgName(pname);    // Remember the name of this application.
279
    TConfig::setProgName(pname);    // Remember the name of this application.
278
#if not defined(Q_OS_ANDROID) && not defined(Q_OS_IOS)
280
#if not defined(Q_OS_ANDROID) && not defined(Q_OS_IOS)
279
    InputParser input(&argc, argv); // Parse the command line parameters.
281
    InputParser input(&argc, argv); // Parse the command line parameters.
280
 
282
 
Line 300... Line 302...
300
            usage();
302
            usage();
301
            return 1;
303
            return 1;
302
        }
304
        }
303
    }
305
    }
304
#endif
306
#endif
-
 
307
    if (haveParameters && configFile.empty())
-
 
308
    {
-
 
309
        cerr << "ERROR: Unknown command line parameter found!" << endl;
-
 
310
        usage();
-
 
311
        return 1;
-
 
312
    }
-
 
313
 
305
    TError::clear();                    // Clear all errors (initialize)
314
    TError::clear();                    // Clear all errors (initialize)
306
    TConfig config(configFile);         // Read the configuration file.
315
    TConfig config(configFile);         // Read the configuration file.
307
 
316
 
308
    if (TError::isError())              // Exit if the previous command failed.
317
    if (TError::isError())              // Exit if the previous command failed.
309
    {
318
    {