summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/FreezeScript/transformdb.cpp6
-rw-r--r--cpp/src/Glacier2/Glacier2Router.cpp1
-rw-r--r--cpp/src/IceGrid/Client.cpp3
-rw-r--r--cpp/src/IceGrid/IceGridRegistry.cpp1
-rw-r--r--cpp/src/IceStorm/Admin.cpp3
5 files changed, 12 insertions, 2 deletions
diff --git a/cpp/src/FreezeScript/transformdb.cpp b/cpp/src/FreezeScript/transformdb.cpp
index b3a5a6adec4..150235e3ea1 100644
--- a/cpp/src/FreezeScript/transformdb.cpp
+++ b/cpp/src/FreezeScript/transformdb.cpp
@@ -409,6 +409,12 @@ run(int argc, char** argv, const Ice::CommunicatorPtr& communicator)
{
dbEnvNameNew = args[2];
}
+ if(args.size() > 3)
+ {
+ cerr << argv[0] << ": too many arguments" << endl;
+ usage(argv[0]);
+ return EXIT_FAILURE;
+ }
Slice::UnitPtr oldUnit = Slice::Unit::createUnit(true, true, ice, caseSensitive);
FreezeScript::Destroyer<Slice::UnitPtr> oldD(oldUnit);
diff --git a/cpp/src/Glacier2/Glacier2Router.cpp b/cpp/src/Glacier2/Glacier2Router.cpp
index a7d6495030f..9cbeadab7a6 100644
--- a/cpp/src/Glacier2/Glacier2Router.cpp
+++ b/cpp/src/Glacier2/Glacier2Router.cpp
@@ -126,6 +126,7 @@ Glacier2::RouterService::start(int argc, char* argv[])
if(!args.empty())
{
+ cerr << argv[0] << ": too many arguments" << endl;
usage(argv[0]);
return false;
}
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index 55adf95850d..3e67844adc0 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -275,6 +275,7 @@ Client::run(int argc, char* argv[])
}
if(!args.empty())
{
+ cerr << argv[0] << ": too many arguments" << endl;
usage();
return EXIT_FAILURE;
}
@@ -549,7 +550,7 @@ Client::run(int argc, char* argv[])
{
Lock sync(*this);
- _parser = Parser::createParser(communicator(), session, admin, args.empty() && commands.empty());
+ _parser = Parser::createParser(communicator(), session, admin, commands.empty());
}
if(!commands.empty()) // Commands were given
diff --git a/cpp/src/IceGrid/IceGridRegistry.cpp b/cpp/src/IceGrid/IceGridRegistry.cpp
index dd64780d214..ca7e65ac479 100644
--- a/cpp/src/IceGrid/IceGridRegistry.cpp
+++ b/cpp/src/IceGrid/IceGridRegistry.cpp
@@ -98,6 +98,7 @@ RegistryService::start(int argc, char* argv[])
if(!args.empty())
{
+ cerr << argv[0] << ": too many arguments" << endl;
usage(argv[0]);
return false;
}
diff --git a/cpp/src/IceStorm/Admin.cpp b/cpp/src/IceStorm/Admin.cpp
index 9cf383482f5..79c0a3c17e5 100644
--- a/cpp/src/IceStorm/Admin.cpp
+++ b/cpp/src/IceStorm/Admin.cpp
@@ -38,7 +38,7 @@ main(int argc, char* argv[])
void
Client::usage()
{
- cerr << "Usage: " << appName() << " [options] [file...]\n";
+ cerr << "Usage: " << appName() << " [options]\n";
cerr <<
"Options:\n"
"-h, --help Show this message.\n"
@@ -77,6 +77,7 @@ Client::run(int argc, char* argv[])
}
if(!args.empty())
{
+ cerr << argv[0] << ": too many arguments" << endl;
usage();
return EXIT_FAILURE;
}