diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-03-27 22:00:22 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-03-27 22:00:22 +0000 |
commit | 411a6e1088238d9cc02899528f42965705f11eb3 (patch) | |
tree | 4c3def6fa1749b006a01ff9eac4ab313e87571f9 /cpp/src | |
parent | replacing StringBoolDict with StringStringDict (diff) | |
download | ice-411a6e1088238d9cc02899528f42965705f11eb3.tar.bz2 ice-411a6e1088238d9cc02899528f42965705f11eb3.tar.xz ice-411a6e1088238d9cc02899528f42965705f11eb3.zip |
removing shutdown command; adding type to topic
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceStorm/Parser.cpp | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/cpp/src/IceStorm/Parser.cpp b/cpp/src/IceStorm/Parser.cpp index d7044930e7b..f7b67b7303f 100644 --- a/cpp/src/IceStorm/Parser.cpp +++ b/cpp/src/IceStorm/Parser.cpp @@ -47,24 +47,27 @@ Parser::usage() cout << "help Print this message.\n" "exit, quit Exit this program.\n" - "create TOPICS Add TOPICS.\n" + "create TOPIC TYPE Add TOPIC with TYPE.\n" "destroy TOPICS Remove TOPICS.\n" "link FROM TO COST Link FROM to TO with the given COST.\n" "unlink FROM TO Unlink TO from FROM.\n" "graph DATA COST Construct the link graph as described in DATA with COST\n" "list [TOPICS] Display information on TOPICS or all topics.\n" - "shutdown Shut the IceStorm server down.\n"; + ; } void Parser::create(const list<string>& args) { + if(args.size() != 2) + { + error("`create' requires exactly two arguments (type `help' for more info)"); + return; + } + try { - for(list<string>::const_iterator i = args.begin(); i != args.end() ; ++i) - { - _admin->create(*i); - } + _admin->create(args.front(), args.back()); } catch(const Exception& ex) { @@ -272,7 +275,6 @@ Parser::graph(const list<string>& _args) return; } - try { WeightedGraph graph; @@ -282,7 +284,6 @@ Parser::graph(const list<string>& _args) return; } - // // Compute the new edge set. // @@ -373,21 +374,6 @@ Parser::graph(const list<string>& _args) } void -Parser::shutdown() -{ - try - { - _admin->shutdown(); - } - catch(const Exception& ex) - { - ostringstream s; - s << ex; - error(s.str()); - } -} - -void Parser::getInput(char* buf, int& result, int maxSize) { if(!_commands.empty()) |