Complain about given arguments if none are required.
authorFlorian Pose <fp@igh-essen.com>
Thu, 19 Mar 2009 08:43:05 +0000
changeset 1373 e651000f1ff1
parent 1372 6b45c4c6f56f
child 1374 1ca1178a3f93
Complain about given arguments if none are required.
tool/CommandConfig.cpp
tool/CommandData.cpp
tool/CommandDomains.cpp
tool/CommandMaster.cpp
tool/CommandPdos.cpp
tool/CommandSdos.cpp
tool/CommandSiiRead.cpp
tool/CommandSlaves.cpp
tool/CommandVersion.cpp
tool/CommandXml.cpp
--- a/tool/CommandConfig.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandConfig.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -105,6 +105,12 @@
 {
     ConfigList configs;
 
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
     configs = selectedConfigs(m);
 
--- a/tool/CommandData.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandData.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -68,6 +68,12 @@
 	DomainList domains;
 	DomainList::const_iterator di;
 	
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
 	domains = selectedDomains(m);
 
--- a/tool/CommandDomains.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandDomains.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -94,6 +94,12 @@
 	DomainList domains;
 	DomainList::const_iterator di;
 	
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
 	domains = selectedDomains(m);
 
--- a/tool/CommandMaster.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandMaster.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -66,6 +66,11 @@
     stringstream err;
     unsigned int i;
     
+    if (args.size()) {
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
     m.getMaster(&data);
 
--- a/tool/CommandPdos.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandPdos.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -94,6 +94,12 @@
     SlaveList::const_iterator si;
     bool showHeader;
     
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
     slaves = selectedSlaves(m);
     showHeader = slaves.size() > 1;
--- a/tool/CommandSdos.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandSdos.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -85,6 +85,12 @@
     SlaveList::const_iterator si;
     bool showHeader;
 
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
     slaves = selectedSlaves(m);
     showHeader = slaves.size() > 1;
--- a/tool/CommandSiiRead.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandSiiRead.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -83,6 +83,11 @@
     uint16_t categoryType, categorySize;
     stringstream err;
 
+    if (args.size()) {
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
     slaves = selectedSlaves(m);
 
--- a/tool/CommandSlaves.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandSlaves.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -109,6 +109,12 @@
 {
     SlaveList slaves;
     
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
     slaves = selectedSlaves(m);
 
--- a/tool/CommandVersion.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandVersion.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -56,6 +56,12 @@
 
 void CommandVersion::execute(MasterDevice &m, const StringVector &args)
 {
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     cout << "IgH EtherCAT master " << EC_MASTER_VERSION << endl;
 }
 
--- a/tool/CommandXml.cpp	Thu Mar 19 08:42:33 2009 +0000
+++ b/tool/CommandXml.cpp	Thu Mar 19 08:43:05 2009 +0000
@@ -73,6 +73,12 @@
     SlaveList slaves;
     SlaveList::const_iterator si;
 
+    if (args.size()) {
+        stringstream err;
+        err << "'" << getName() << "' takes no arguments!";
+        throwInvalidUsageException(err);
+    }
+
     m.open(MasterDevice::Read);
     slaves = selectedSlaves(m);