boost::prior(path.end())),
dir);
DirectoryNode & base (*dir.back().lock());
- std::string const & name (boost::prior(path.end())->value());
+ std::string const & name (complete(base, boost::prior(path.end())->value()));
if (policy_)
policy_( base, name );
return dir.back().lock()->get(name);
;
else {
DirectoryNode & base (*dir.back().lock());
+ std::string name (complete(base, i->value()));
if (policy_)
- policy_( base, i->value() );
- dir.push_back(base[i->value()].thisptr());
+ policy_( base, name );
+ dir.push_back(base[name].thisptr());
}
}
}
}
}
+prefix_ std::string senf::console::Executor::complete(DirectoryNode & dir,
+ std::string const & name)
+{
+ if (! dir.hasChild(name)) {
+ DirectoryNode::ChildrenRange completions (dir.completions(name));
+ if (completions.size() == 1)
+ return completions.begin()->first;
+ }
+ return name;
+}
+
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
//#include "Executor.mpp"