diff -r 65781b048a47 -r ec6223c3b7ec tool/CommandFoeWrite.cpp --- a/tool/CommandFoeWrite.cpp Tue Feb 23 17:40:46 2010 +0100 +++ b/tool/CommandFoeWrite.cpp Wed Feb 24 16:27:11 2010 +0100 @@ -37,6 +37,7 @@ #include "CommandFoeWrite.h" #include "foe.h" +#include "MasterDevice.h" /*****************************************************************************/ @@ -79,7 +80,7 @@ /****************************************************************************/ -void CommandFoeWrite::execute(MasterDevice &m, const StringVector &args) +void CommandFoeWrite::execute(const StringVector &args) { stringstream err; ec_ioctl_slave_foe_t data; @@ -92,6 +93,12 @@ throwInvalidUsageException(err); } + if (getMasterIndices().size() != 1) { + err << getName() << " requires to select a single master!"; + throwInvalidUsageException(err); + } + MasterDevice m(getMasterIndices().front()); + if (args[0] == "-") { loadFoeData(&data, cin); if (getOutputFile().empty()) {