equal
deleted
inserted
replaced
|
1 /***************************************************************************** |
|
2 * |
|
3 * $Id$ |
|
4 * |
|
5 ****************************************************************************/ |
|
6 |
|
7 #include <sstream> |
|
8 #include <iomanip> |
|
9 using namespace std; |
|
10 |
|
11 #include "globals.h" |
|
12 |
|
13 /*****************************************************************************/ |
|
14 |
|
15 const char *help_debug = |
|
16 "[OPTIONS]\n" |
|
17 "\n" |
|
18 "\n" |
|
19 "Command-specific options:\n"; |
|
20 |
|
21 /****************************************************************************/ |
|
22 |
|
23 void command_debug(void) |
|
24 { |
|
25 stringstream str; |
|
26 int debugLevel; |
|
27 |
|
28 if (commandArgs.size() != 1) { |
|
29 stringstream err; |
|
30 err << "'debug' takes exactly one argument!"; |
|
31 throw MasterDeviceException(err.str()); |
|
32 } |
|
33 |
|
34 str << commandArgs[0]; |
|
35 str >> resetiosflags(ios::basefield) // guess base from prefix |
|
36 >> debugLevel; |
|
37 |
|
38 if (str.fail()) { |
|
39 stringstream err; |
|
40 err << "Invalid debug level '" << commandArgs[0] << "'!"; |
|
41 throw MasterDeviceException(err.str()); |
|
42 } |
|
43 |
|
44 masterDev.open(MasterDevice::ReadWrite); |
|
45 masterDev.setDebug(debugLevel); |
|
46 } |
|
47 |
|
48 /*****************************************************************************/ |