Commit c3d17863 by Francois Gygi

modified to allow arbitrary values


git-svn-id: http://qboxcode.org/svn/qb/trunk@455 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 7104f3e0
......@@ -3,7 +3,7 @@
// Debug.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: Debug.h,v 1.1 2004-03-11 22:01:24 fgygi Exp $
// $Id: Debug.h,v 1.2 2006-07-21 17:48:56 fgygi Exp $
#ifndef DEBUG_H
#define DEBUG_H
......@@ -25,36 +25,13 @@ class Debug : public Var
int set ( int argc, char **argv )
{
const string allowed_values("OFF STRESS");
if ( argc < 2 )
{
if ( ui->onpe0() )
cout << " debug must be in " << allowed_values << endl;
return 1;
}
string v;
for ( int iarg = 1; iarg < argc; iarg++ )
{
string vt = argv[iarg];
if ( allowed_values.find(vt) == string::npos )
{
// not a valid argument
if ( ui->onpe0() )
{
cout << vt << " is not a valid debug option " << endl;
cout << " valid debug options are: " << allowed_values << endl;
}
return 1;
}
v += " " + vt;
}
// check if OFF is found in the string v
if ( v.find("OFF") != string::npos )
v = "OFF";
s->ctrl.debug = v;
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment