tools/main.cpp
changeset 1099 eb8d16507d88
parent 1066 7ece00bd6559
child 1118 9487162e4d4d
--- a/tools/main.cpp	Mon Jul 07 07:38:10 2008 +0000
+++ b/tools/main.cpp	Mon Jul 07 07:55:41 2008 +0000
@@ -22,8 +22,7 @@
 static int domainIndex = -1;
 static string command;
 vector<string> commandArgs;
-static bool quiet = false;
-static bool verbose = false;
+static Master::Verbosity verbosity = Master::Normal;
 string dataTypeStr;
 bool force = false;
 
@@ -141,13 +140,11 @@
                 break;
 
             case 'q':
-                quiet = true;
-                verbose = false;
+                verbosity = Master::Quiet;
                 break;
 
             case 'v':
-                verbose = true;
-                quiet = false;
+                verbosity = Master::Verbose;
                 break;
 
             case 'h':
@@ -182,13 +179,14 @@
     
 	getOptions(argc, argv);
 
+    master.setIndex(masterIndex);
+    master.setVerbosity(verbosity);
+
     try {
-        master.setIndex(masterIndex);
-
         if (command == "alias") {
             master.writeAlias(slavePosition, force, commandArgs);
         } else if (command == "config") {
-            master.showConfigs(verbose);
+            master.showConfigs();
         } else if (command == "data") {
             master.outputData(domainIndex);
         } else if (command == "debug") {
@@ -198,16 +196,16 @@
 		} else if (command == "master") {
             master.showMaster();
         } else if (command == "pdos") {
-            master.listPdos(slavePosition, quiet);
+            master.listPdos(slavePosition);
         } else if (command == "sdos") {
-            master.listSdos(slavePosition, quiet);
+            master.listSdos(slavePosition);
         } else if (command == "sdo_download" || command == "sd") {
             master.sdoDownload(slavePosition, dataTypeStr, commandArgs);
         } else if (command == "sdo_upload" || command == "su") {
             master.sdoUpload(slavePosition, dataTypeStr, commandArgs);
 		} else if (command == "slave" || command == "slaves"
                 || command == "list" || command == "ls") {
-            master.showSlaves(slavePosition, verbose);
+            master.showSlaves(slavePosition);
         } else if (command == "sii_read" || command == "sr") {
             master.siiRead(slavePosition);
         } else if (command == "sii_write" || command == "sw") {