# HG changeset patch # User kantorhs # Date 1413578256 0 # Node ID e82c86964673b25152617d3463eef0dc12483b6b # Parent 98a29a766c3c9e1e4ae251197cecfd04cf8d2dc7 added ability to supply a number of commands to icestormadmin via a command file as described in the Topic Federation documentation diff -r 98a29a766c3c -r e82c86964673 Admin.cpp --- a/Admin.cpp Fri Oct 17 15:07:26 2014 -0500 +++ b/Admin.cpp Fri Oct 17 20:37:36 2014 +0000 @@ -8,6 +8,7 @@ // ********************************************************************** #include +#include #include #include #include @@ -88,7 +89,7 @@ usage(); return EXIT_FAILURE; } - if(!args.empty()) + if(args.size() > 1) { cerr << argv[0] << ": too many arguments" << endl; usage(); @@ -115,6 +116,27 @@ } debug = opts.isSet("debug"); + if (args.size() == 1) + { + IceUtilInternal::ifstream commandFile(args[0]); + + if (!commandFile) + { + cerr << "unable to open command file" << endl; + return EXIT_FAILURE; + } + + string line; + + while(getline(commandFile, line)) + { + commands += line + ";"; + } + + commandFile.close(); + + } + // The complete set of Ice::Identity -> manager proxies. map managers; PropertiesPtr properties = communicator()->getProperties();