Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-11-14 14:14:21 +0000
committerStijn Buys <ingar@osirion.org>2009-11-14 14:14:21 +0000
commit4293e8854a30443e4d5818fc55df404976dbfd9b (patch)
tree816665ba37acfd5a39c0544c3b2acbf04c8c5d3d /src/core/commandbuffer.cc
parenta993d31910b63a1f897e470842934e6ffefad32c (diff)
update the info system, fixes network info exchange
Diffstat (limited to 'src/core/commandbuffer.cc')
-rw-r--r--src/core/commandbuffer.cc58
1 files changed, 54 insertions, 4 deletions
diff --git a/src/core/commandbuffer.cc b/src/core/commandbuffer.cc
index fc98e21..00a3486 100644
--- a/src/core/commandbuffer.cc
+++ b/src/core/commandbuffer.cc
@@ -44,11 +44,61 @@ void func_print_file(std::string const &args)
void func_list_info(std::string const &args)
{
- Info *info = Info::find(args);
- if (info)
- info->print();
- else
+ std::string typestr;
+ std::string labelstr;
+
+ std::istringstream argstream(args);
+ if (!(argstream >> typestr)) {
+ // no argument, list all info records
Info::list();
+ return;
+ }
+
+ Info *info = 0;
+ InfoType *infotype = InfoType::find(typestr);
+
+ if(!(argstream >> labelstr)) {
+ // a single argument
+ if (infotype) {
+ // list all the records of a single type
+ Info::list(infotype);
+ return;
+ }
+
+ info = Info::find(typestr);
+ if (info) {
+ // list a single record
+ info->print();
+ return;
+ }
+
+ info = Info::search(typestr);
+ if (info) {
+ // list a single record
+ info->print();
+ return;
+ }
+
+ con_print << "Unkown info record '" << typestr << "'" << std::endl;
+
+ } else {
+ // two arguments
+ info = Info::find(infotype, labelstr);
+ if (info) {
+ // list a single record
+ info->print();
+ return;
+ }
+
+ info = Info::search(infotype, labelstr);
+ if (info) {
+ // list a single record
+ info->print();
+ return;
+ }
+
+ con_print << "Unkown info record '" << typestr << "' for type '" << typestr << "'" << std::endl;
+ }
}
void func_list_func(std::string const &args)