Changeset 10221 for trunk/FACT++/src
- Timestamp:
- 03/03/11 19:30:44 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dclient5.cc
r10183 r10221 466 466 const string n = conf.GetName()+".log"; 467 467 468 po::options_description config(" Configuration");468 po::options_description config("Program options"); 469 469 config.add_options() 470 ("dns", var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)") 470 471 ("log,l", var<string>(n), "Write log-file") 471 ("no-dim,d", po_switch(), "Disable dim services")472 ("console,c", var<int>(), "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")472 ("no-dim,d", po_switch(), "Disable dim services") 473 ("console,c", var<int>(), "Use console (0=shell, 1=simple buffered, X=simple unbuffered)") 473 474 ; 474 475 475 conf.AddOptionsCommandline(config); 476 conf.AddEnv("dns", "DIM_DNS_NODE"); 477 478 conf.AddOptions(config); 476 479 } 477 480 478 481 int main(int argc, char* argv[]) 479 482 { 480 setenv("DIM_DNS_NODE", "localhost", 0);481 482 483 Configuration conf(argv[0]); 483 484 SetupConfiguration(conf); … … 503 504 return -1; 504 505 506 // To allow overwriting of DIM_DNS_NODE set 0 to 1 507 setenv("DIM_DNS_NODE", conf.Get<string>("dns").c_str(), 1); 508 505 509 try 506 510 { -
trunk/FACT++/src/test3.cc
r10183 r10221 36 36 const string n = conf.GetName()+".log"; 37 37 38 po::options_description config(" Configuration");38 po::options_description config("Program options"); 39 39 config.add_options() 40 ("dns", var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)") 40 41 ("log,l", var<string>(n), "Write log-file") 41 42 ("console,c", var<int>(), "Use console (0=shell, 1=simple buffered, X=simple unbuffered)") 42 43 ; 43 44 44 conf.AddOptionsCommandline(config); 45 conf.AddEnv("dns", "DIM_DNS_NODE"); 46 47 conf.AddOptions(config); 45 48 } 46 49 … … 48 51 { 49 52 cout << "Starting " << argv[0] << "..." << endl; 50 51 // We could use putenv to make the Configure class change the value...52 setenv("DIM_DNS_NODE", "localhost", 0);53 53 54 54 Configuration conf(argv[0]); … … 75 75 return -1; 76 76 77 // To allow overwriting of DIM_DNS_NODE set 0 to 1 78 setenv("DIM_DNS_NODE", conf.Get<string>("dns").c_str(), 1); 79 77 80 if (conf.Get<int>("console")==0) 78 81 RunShell<RemoteShell>(conf);
Note:
See TracChangeset
for help on using the changeset viewer.