// $Id$
//
-// Copyright (C) 2009
+// Copyright (C) 2009
// Fraunhofer Institute for Open Communication Systems (FOKUS)
// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
// Custom includes
#include <senf/Utils/Logger/SenfLog.hh>
-#include <senf/Utils/range.hh>
+#include <senf/Utils/Range.hh>
+#include <senf/Utils/membind.hh>
//#include "LineEditor.mpp"
#define prefix_
senf::membind(&LineEditorClientReader::deleteCharOrExit, this));
editor_.defineKey(senf::term::KeyParser::Tab,
boost::bind(&term::bindings::complete,
- _1,
+ _1,
senf::membind(&LineEditorClientReader::completePath, this)));
editor_.defineKey(senf::term::KeyParser::Return, &senf::term::bindings::acceptWithRepeat);
}
std::string const & t (editor.text());
// Search backward from e finding the longest valid path. This does *not* accept all valid
// path's, only those without embedded white-space. However, this is only for completion so
- // it's ok.
+ // it's ok.
if (b<e) {
unsigned bb (e-1);
for (;;) {
catch (CommandParser::ParserErrorException & ex) {
return;
}
-
+
ParseCommandInfo::TokensRange path (cmd.commandPath());
if (path.empty()) {
DirectoryNode::ChildrenRange cs (client().cwd().children());
completions.push_back(i->first + (i->second->followLink().isDirectory() ? "/" : " "));
return;
}
-
+
ParseCommandInfo::TokensRange::const_iterator i (path.begin());
ParseCommandInfo::TokensRange::const_iterator const i_end (boost::prior(path.end()));
DirectoryNode * dir (& client().cwd());
if (parent) dir = parent;
prefix += "../";
}
- else if (*i == WordToken("."))
+ else if (*i == WordToken("."))
prefix += "./";
else {
if (dir->hasChild(i->value())) {
return;
}
prefix += i->value() + "/";
- }
+ }
else {
DirectoryNode::ChildrenRange cs (dir->completions(i->value()));
if (has_one_elt(cs)) {