# HG changeset patch # User Florian Pose # Date 1237452185 0 # Node ID e651000f1ff1bdea539af6b7671cc3d60638c162 # Parent 6b45c4c6f56fa685936113629294f85d1f3d0c2c Complain about given arguments if none are required. diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandConfig.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); diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandData.cpp --- 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); diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandDomains.cpp --- 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); diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandMaster.cpp --- 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); diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandPdos.cpp --- 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; diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandSdos.cpp --- 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; diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandSiiRead.cpp --- 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); diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandSlaves.cpp --- 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); diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandVersion.cpp --- 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; } diff -r 6b45c4c6f56f -r e651000f1ff1 tool/CommandXml.cpp --- 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);