summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Parser.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-11-08 10:00:09 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-11-08 10:00:09 +0000
commit2496d1c85fe8bd9fe7f343084ba68ac99b7abaac (patch)
treeded7d3c012a30f978db0fb2ecf81fadcfcebfe52 /cpp/src/IceGrid/Parser.cpp
parentwindows fixes for http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=534 (diff)
downloadice-2496d1c85fe8bd9fe7f343084ba68ac99b7abaac.tar.bz2
ice-2496d1c85fe8bd9fe7f343084ba68ac99b7abaac.tar.xz
ice-2496d1c85fe8bd9fe7f343084ba68ac99b7abaac.zip
Bug fixes
Diffstat (limited to 'cpp/src/IceGrid/Parser.cpp')
-rw-r--r--cpp/src/IceGrid/Parser.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp
index 91ed2165125..f7969448903 100644
--- a/cpp/src/IceGrid/Parser.cpp
+++ b/cpp/src/IceGrid/Parser.cpp
@@ -103,14 +103,8 @@ Parser::usage()
" started on demand or administratively).\n"
"\n"
"adapter list List all registered adapters.\n"
- "adapter endpoints ID [REPLICAID]\n"
- " Show the endpoints of adapter ID from replica REPLICAID.\n"
- " If REPLICAID is not specified, show the endpoints of all\n"
- " the registered replicas.\n"
- "adapter remove ID [REPLICAID]\n"
- " Remove the endpoints of adapter ID from replica REPLICAID.\n"
- " If REPLICAID is not specified, remove the endpoints of all\n"
- " the registered replicas.\n"
+ "adapter endpoints ID Show the endpoints of adapter or replica group ID.\n"
+ "adapter remove ID Remove adapter or replica group ID.\n"
"\n"
"object add PROXY [TYPE] Add an object to the object registry,\n"
" optionally specifying its type.\n"
@@ -944,9 +938,9 @@ Parser::listAllServers()
void
Parser::endpointsAdapter(const list<string>& args)
{
- if(args.size() < 1)
+ if(args.size() != 1)
{
- error("`adapter endpoints' requires at least one argument\n(`help' for more info)");
+ error("`adapter endpoints' requires exactly one argument\n(`help' for more info)");
return;
}
@@ -955,15 +949,9 @@ Parser::endpointsAdapter(const list<string>& args)
list<string>::const_iterator p = args.begin();
string adapterId = *p++;
StringObjectProxyDict proxies = _admin->getAdapterEndpoints(adapterId);
- if(args.size() > 1)
+ if(proxies.size() == 1 && proxies.begin()->first == adapterId)
{
- string serverId = *p++;
- if(proxies.find(serverId) == proxies.end())
- {
- throw ServerNotExistException();
- }
-
- string endpoints = _communicator->proxyToString(proxies[serverId]);
+ string endpoints = _communicator->proxyToString(proxies.begin()->second);
cout << (endpoints.empty() ? "<inactive>" : endpoints) << endl;
}
else